PDFly is 100% client-side. This documentation helps developers integrate PDF tools into their own apps using the same libraries.
Embed as iframe
Add PDFly tools to your website in minutes.
pdf-lib docs
Official library for creating and modifying PDFs.
PDF.js docs
Mozilla's PDF rendering engine for the web.
PDFly processes all files directly in the browser. No data is uploaded to any server. Here are the core technologies powering each tool:
Server-side rendering, routing, and static page generation. All pages are pre-rendered for SEO.
Client-side PDF creation, modification, and encryption. Supports merge, split, protect, watermark, and metadata editing.
Client-side PDF rendering and text extraction. Used for previews, PDF-to-Word conversion, and page inspection.
Browser-based OCR engine using WebAssembly. Extracts text from scanned documents and images.
Renders PDF pages to images for compression, grayscale conversion, redaction, and format conversion.
Offloads heavy computation off the main thread to prevent UI freezing during large file operations.
Use the same libraries PDFly uses to add PDF manipulation to your own applications.
Merge, split, protect, and extract text from PDFs. Install with npm install pdf-lib
// Install: npm install pdf-lib
import { PDFDocument } from 'pdf-lib';
// Merge multiple PDFs
async function mergePDFs(pdfBuffers) {
const merged = await PDFDocument.create();
for (const buffer of pdfBuffers) {
const pdf = await PDFDocument.load(buffer);
const pages = await merged.copyPages(pdf, pdf.getPageIndices());
pages.forEach(page => merged.addPage(page));
}
return merged.save();
}
// Split PDF - extract specific pages
async function splitPDF(pdfBuffer, pageIndices) {
const pdf = await PDFDocument.load(pdfBuffer);
const split = await PDFDocument.create();
const pages = await split.copyPages(pdf, pageIndices);
pages.forEach(page => split.addPage(page));
return split.save();
}
// Add password protection
async function protectPDF(pdfBuffer, password) {
const pdf = await PDFDocument.load(pdfBuffer);
pdf.encrypt({
userPassword: password,
ownerPassword: password,
permissions: { printing: 'low-resolution' },
});
return pdf.save();
}
// Extract text with PDF.js
async function extractText(pdfBuffer) {
const pdf = await pdfjsLib.getDocument({ data: pdfBuffer }).promise;
let text = '';
for (let i = 1; i <= pdf.numPages; i++) {
const page = await pdf.getPage(i);
const content = await page.getTextContent();
text += content.items.map(item => item.str).join(' ') + '\n';
}
return text;
}PDFly relies on these open-source libraries for all PDF operations:
pdf-lib
Create, modify, encrypt, merge, and split PDFs. Works in all browsers and Node.js.
npm install pdf-libPDF.js
Mozilla's PDF renderer. Extract text, render pages to canvas, and read PDF metadata.
npm install pdfjs-distTesseract.js
OCR engine running entirely in the browser via WebAssembly. Extract text from scanned documents.
npm install tesseract.jsdocx
Create Word documents (.docx) from extracted PDF text content.
npm install docxpypdf
Python library for reading, splitting, merging, and encrypting PDF files.
pip install pypdfLooking to embed PDFly directly in your app?
View Embed Documentation