Install
One command. The package is on npm today.
npm install @pdfluent/sdk-wasmCross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp). The PDFluent playground is configured this way.Smoke test
Open a PDF, print the page count. The example below is the smallest useful program — copy, paste, run.
import init, { PdfDocument } from '@pdfluent/sdk-wasm';
await init();
const bytes = new Uint8Array(await file.arrayBuffer());
const doc = PdfDocument.open(bytes);
console.log(`${doc.pageCount()} pages`);Structured extraction (Preview)
PreviewIn WebAssembly, structured extraction returns Markdown from doc.extractMarkdown, blocks as a JSON string from doc.extractBlocks, and Docling JSON from extractDocling. Structured extraction ships as Preview: output quality is still improving and the API may change in a minor release.
- Fast tier only;
balancedis native only and never runs in WebAssembly. - Fast tier is the engine alone, pure Rust, no models.
- Docling JSON:
extractDocling(firstPage, pageCount, name);extractBlocksreturns a JSON string. - Also new in 1.1.0: encryptPdf/decryptPdf, PdfDoc.addWatermark, extractImages, signPdf.
What this is good for
- In-browser PDF processing — no server required
- Privacy-sensitive client-side workflows
- SaaS demos and document previews
Current limitations
This list is honest, not exhaustive. The site-wide list lives at Known limitations.
- Threaded execution requires the page to be served with COOP/COEP headers.
- Bundle size: the WASM binary is several MB. Pre-fetch and cache aggressively.
- XFA rendering fidelity is improving alongside the Rust core.
Licensing
PDFluent is published under the AGPLv3 and is complete under it. A yearly commercial licence removes the obligation to publish your own source; nothing in the build differs and nothing is activated, so a lapsed licence breaks nothing you have shipped. Details on the licensing page.