From PDF.js to PDFox.js — a proprietary, TypeScript-first PDF engine built from scratch. It runs entirely in your browser — your files never leave your device.
PDF.js is Mozilla's open-source PDF viewer. It has served the web well for 16+ years. But it was designed for one purpose: displaying PDFs on a canvas element. It was never meant for editing.
PDF.js renders to HTML Canvas — a 2D drawing API originally created by Apple in 2004 for macOS Dashboard widgets, not for PDFs. It became the de facto rendering target because PDF operators map conveniently to Canvas API calls — both are immediate-mode drawing systems. But that convenience ends at rendering. Canvas produces pixels, and pixels can't be edited.
PDF.js renders to HTML Canvas — a pixel-based drawing surface. The output is a flat image with no interactive elements.
Editing score: 1/10. The library provides zero editing capabilities. Services must build entire editing layers from scratch on top of it.
~60,000 lines of JavaScript in a single monolithic worker. No tree-shaking, no modular imports. You load everything or nothing.
PDFox.js is a proprietary PDF engine written in TypeScript from the ground up. It's designed around a single principle: the PDF stream should be directly representable as editable DOM elements.
Text becomes contentEditable spans. Graphics become SVG. Images become DOM elements. The PDF is the document — not a picture of it.
~30,000 lines of TypeScript across 11 independent, tree-shakeable packages. Import only what you need.
Built natively on the latest PDF standard — not a retrofit. 256-bit AES encryption, CAdES signatures, UTF-8 encoding, Document Security Store, tagged PDF namespaces. 94/104 rendering features wired.
Performance-critical operations (compression, crypto, CMap parsing, content processing) run in Rust-compiled WASM. No JavaScript fallbacks.
Same content stream renders to DOM, Canvas, and SVG. Choose the right output for your use case.
Editing score: 8/10. The only engine with built-in contentEditable editing. PDF.js and pdfium both score 1/10.
A side-by-side comparison of the V1 engine (PDF.js) and V2 engine (PDFox.js) across key dimensions.
| Aspect | V1 (PDF.js) | V2 (PDFox.js) |
|---|---|---|
| Language | JavaScript | TypeScript |
| Codebase | ~60K LoC (monolithic) | ~30K LoC (11 packages) |
| Render Target | Canvas only | DOM + Canvas + SVG |
| Editing | None (score: 1/10) | contentEditable DOM (score: 8/10) |
| WASM | Compression + QCMS only | Compression, crypto, CMap, content stream |
| Tree-Shakeable | No | Yes (11 independent packages) |
| Font Engine | JS (Type1→OTF conversion) | @font-face (native browser) |
| BiDi/RTL | Basic (score: 7/10) | Full UAX #9 (score: 9/10) |
| OpenType Features | Minimal (score: 3/10) | Full GSUB/GPOS parser (score: 8/10) |
| Overprint | XFA-only (score: 2/10) | Full CMYK/Separation/DeviceN (score: 8/10) |
| PDF Standard | PDF 1.7+ (partial 2.0) | PDF 2.0 (ISO 32000-2:2020) native |
| Encryption | RC4 / AES-128 | AES-256 (PDF 2.0) + RC4/AES-128 legacy |
| License | Apache 2.0 (open-source) | Proprietary |
| Maturity | 16+ years | < 1 year |
PDF.js and pdfium were built around older PDF specifications and have gradually adopted newer features over time. PDFox.js was designed from scratch on PDF 2.0 (ISO 32000-2:2020) — the most current revision of the PDF standard, published with Errata Collection 2.
PDF 2.0 mandates AES-256 as the encryption standard, replacing older RC4 and 128-bit AES. PDFox.js implements this natively via Web Crypto API and WASM.
PDF 2.0 introduces CAdES (CMS Advanced Electronic Signatures) with PAdES support, replacing the deprecated adbe.pkcs7.sha1. Full PKCS#7/CMS signing built in.
PDF 2.0 allows UTF-8 text strings natively, eliminating the legacy PDFDocEncoding limitations. Full Unicode support across all text operations.
DSS enables long-term signature validation by embedding all required certificates, CRLs, and OCSP responses directly in the PDF file.
PDF 2.0's namespace mechanism allows role mapping between standard structure types and custom tags, enabling richer accessibility and semantic markup.
Full validation for the latest archival (PDF/A-1 through PDF/A-4) and accessibility (PDF/UA-1 & PDF/UA-2) standards — both based on PDF 2.0.
Across 104 rendering features benchmarked against both PDF.js and pdfium, PDFox.js takes the lead in categories that matter most for editing.
Scores out of 10. Based on ISO 32000-2:2020 compliance audit across 104 rendering features.
All performance-critical codepaths run in Rust-compiled WASM with zero JavaScript fallbacks. Compression, cryptography, CMap parsing, and content stream processing all execute at near-native speed.
The only PDF engine that renders directly to editable DOM elements. Text is contentEditable, graphics are SVG, and the browser handles layout — no pixel-level coordinate math required.
11 independent npm packages, each tree-shakeable. Build a viewer with 3 packages or a full editor with all 11. Pay only for what you use.
1,100-line GSUB/GPOS parser wired directly to the content stream interpreter. Ligatures, kerning, and advanced typography rendered correctly — not approximated.
Explore how PDFox.js is structured as a modular, 11-package TypeScript monorepo.
View Architecture