# PDFluent for WASM/JS — npm install @pdfluent/sdk-wasm

Source: https://pdfluent.com/docs/wasm/

Channel guide

# PDFluent for WASM / JavaScript

Generally available Updated 2026-05-14

[Star on GitHub](https://github.com/pdfluent/pdfluent-sdk)

### On this page

- Install
- Smoke test
- Structured extraction (Preview)
- What this is good for
- Current limitations
- Licensing
- Where to go next

## Install

One command. The package is on [npm](https://www.npmjs.com/package/@pdfluent/sdk-wasm) 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`);
```

## Structured extraction (Preview)

Preview In 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; `balanced` is native only and never runs in WebAssembly.
- Fast tier is the engine alone, written in Rust, no models.
- Docling JSON: `extractDocling(firstPage, pageCount, name)`; `extractBlocks` returns 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](https://pdfluent.com/docs/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](https://pdfluent.com/docs/licensing/).

## Where to go next

- [Open npm Browse versions and the published API.](https://www.npmjs.com/package/@pdfluent/sdk-wasm)
- [View pricing Annual licences with perpetual-fallback.](https://pdfluent.com/pricing/)
- [Try the playground](https://pdfluent.com/playground/)
- [All language channels The hub lists all language channels.](https://pdfluent.com/docs/)
