API & Developer Documentation
Paperly is a fully client-side PDF processing platform. There is no server API — every tool runs in your browser. This page explains the architecture for developers who want to understand, extend, or integrate with Paperly.
Architecture Overview
Paperly processes every PDF entirely in your browser using WebAssembly, Web Workers, and the Web Crypto API. No file bytes ever leave your device — there are no upload endpoints, no server-side processing, and no cloud storage.
Client-Side Processing Model
- PDF files are read via the FileReader API as ArrayBuffers
- Processing happens in Web Workers using pdf-lib and pdf.js (WASM)
- Output is generated as Blob URLs and offered for download
- No FormData, fetch POST, or XMLHttpRequest sends file data anywhere
- All processing is deterministic and reproducible in any modern browser
Browser Requirements
- Chrome 80+ / Edge 80+ / Firefox 78+ / Safari 14+
- WebAssembly support (all modern browsers)
- IndexedDB for document history (optional)
- getUserMedia for Scan to PDF (optional, camera access)
- Web Crypto API for encrypted shareable links
PDF Libraries Used
- pdf-lib — PDF creation, modification, form filling, signing
- pdf.js (pdfjs-dist) — PDF rendering, text extraction, OCR
- Tesseract.js — OCR engine with 105+ language packs
- mammoth.js — DOCX to HTML conversion
- xlsxLite (in-house) — native .xlsx parsing and generation via JSZip
- html2canvas — HTML to PDF rendering
Extending Paperly
Paperly's tool registry (src/tools/registry.tsx and src/tools/extra.ts) defines each tool with a standardized interface. Each tool exports a process function that accepts File[], options, progress callback, and returns ResultFile[]. New tools can be added by creating an implementation file and registering it.
Security Model
- Content-Security-Policy blocks external script execution
- X-Frame-Options: DENY prevents clickjacking
- No third-party analytics sends document data
- Service Worker caches assets for offline use
- Encrypted shareable links use AES-256-GCM via Web Crypto API
Open Source
Paperly's architecture is built on well-known open source libraries. The tool registration system is straightforward: define a tool in the registry, implement its process function, and register it in the route system. See the source code for examples.