Skip to main content

pdfnova

PDFium-powered PDF library for JavaScript & TypeScript.

Chrome-grade rendering via WebAssembly. Full TypeScript types. Zero-config WASM loading.

npm install pdfnova
import { PDFDocument } from "pdfnova/lite";

const doc = await PDFDocument.open("/report.pdf");
const page = doc.getPage(0);
await page.render(canvas, { scale: 2 });
doc.close();

That's it. No worker setup. No manual WASM configuration. The PDFium engine loads automatically.

Why pdfnova?

pdfnovapdf.jsRaw PDFium
Rendering enginePDFium (Chrome's engine)Custom JS rendererPDFium
JS bundle~3-5 KB~400 KBN/A
WASM binary4.4 MB (cached in IndexedDB)Must compile yourself
TypeScriptFirst-class, fully typedCommunity typesNo types
Text selectionCharacter-level precisionApproximateManual
SearchNative PDFium searchJS-basedManual C API
AnnotationsRead/writeRead onlyManual C API
FormsFill, flatten, readRead onlyManual C API
SignaturesRead & inspectManual C API
WASM setupAutomatic (CDN + IndexedDB cache)Manual Emscripten

Two Tiers

pdfnova ships two entry points — use what you need:

pdfnova/litepdfnova (full)
JS Bundle~3 KB~5 KB
RenderingYesYes
Text extractionYesYes
Text layer (DOM)YesYes
SearchYesYes
Bookmarks/TOCYesYes
Virtual rendererYesYes
Worker poolYesYes
AnnotationsYes
Form fillingYes
Digital signaturesYes
Save modified PDFYes

Both tiers share the same WASM binary (4.4 MB on disk, ~1.5 MB over the wire with Brotli). The binary is cached in IndexedDB after the first load — subsequent visits are instant.

// Lightweight — render, text, search, bookmarks
import { PDFDocument } from "pdfnova/lite";

// Full — everything above + annotations, forms, signatures
import { PDFDocument } from "pdfnova";

Architecture

┌──────────────────────────────────────────────┐
│ PDFDocument / PDFPage │ ← Public API
├──────────────────────────────────────────────┤
│ TextExtractor │ SearchEngine │ PageRenderer │ ← Feature modules
├──────────────────────────────────────────────┤
│ WasmBridge + MemoryManager │ ← Pointer management
├──────────────────────────────────────────────┤
│ WasmLoader (IndexedDB cache) │ ← WASM lifecycle
├──────────────────────────────────────────────┤
│ PDFium (4.4 MB WebAssembly) │ ← Chrome's PDF engine
└──────────────────────────────────────────────┘

Browser Support

BrowserSupported
Chrome 69+Yes
Firefox 62+Yes
Safari 15+Yes
Edge 79+Yes
Node.js 18+Yes (mock mode for testing)