Channel guide

PDFluent for WASM / JavaScript

Generally availableUpdated 2026-05-14
Star on GitHub
On this page

Install

One command. The package is on npm today.

npm install @pdfluent/sdk-wasm
Threaded WASM needs cross-origin-isolation headers (Cross-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.

typescript
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`);

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.

Where to go next