Developer Hub & API Philosophy
Welcome, developers! This page provides information about the architecture of PDF Toolkit and how you can leverage the same technologies in your own projects.
Our Privacy-First Approach: No Server-Side API
PDF Toolkit does not offer a traditional server-side REST API for a very important reason: **your privacy and security**. Our core principle is that your files should never be uploaded to a server. All processing—merging, compressing, converting—happens directly in your browser using JavaScript.
This client-side approach means:
- 100% Privacy: Your files never leave your computer. We cannot see them, access them, or store them.
- Incredible Speed: There is no upload or download time from a server. Operations on small to medium files are almost instant.
- No File Size Limits (from our side): The only limitation is your browser's and computer's processing power.
Our Technology Stack
Our toolkit is built on the shoulders of incredible open-source libraries. If you are a developer, we highly recommend you check them out for your own projects:
- pdf-lib.js: A powerful library for creating and modifying PDF documents in any JavaScript environment. We use it for merging, splitting, and editing.
- PDF.js: Developed by Mozilla, this is the gold standard for rendering and parsing PDF files in the browser. We use it for displaying previews and extracting text.
- JSZip: A fantastic library for creating, reading, and editing .zip files in the browser. This is how we package multiple images (like in PDF to JPG).
Example: Client-Side PDF Merging
To give you an idea, here is a simplified code snippet showing how merging two PDF files would work in JavaScript using `pdf-lib`:
// This code runs entirely in the user's browser
async function mergePdfs(file1, file2) {
const mergedPdf = await PDFLib.PDFDocument.create();
// Load the first PDF
const pdf1Bytes = await file1.arrayBuffer();
const pdf1 = await PDFLib.PDFDocument.load(pdf1Bytes);
const copiedPages1 = await mergedPdf.copyPages(pdf1, pdf1.getPageIndices());
copiedPages1.forEach((page) => mergedPdf.addPage(page));
// Load the second PDF
const pdf2Bytes = await file2.arrayBuffer();
const pdf2 = await PDFLib.PDFDocument.load(pdf2Bytes);
const copiedPages2 = await mergedPdf.copyPages(pdf2, pdf2.getPageIndices());
copiedPages2.forEach((page) => mergedPdf.addPage(page));
// Save the result and prompt for download
const mergedPdfBytes = await mergedPdf.save();
// ... code to download the file ...
}
Future Plans
While we don't plan to offer a server-side API, we are considering releasing a dedicated JavaScript library or a set of components in the future to make it even easier for developers to build powerful, private, client-side document tools. For any business inquiries or partnership ideas, please contact us.