@wasm-zoo/qpdf
v0.1.1
Published
QPDF 12.4.2 compiled for browser WebAssembly by WASM Zoo, with Consumer API v1 and bundled runtime assets.
Maintainers
Readme
@wasm-zoo/qpdf
Unofficial WASM Zoo distribution of the upstream QPDF 12.4.2 CLI for browsers. This package is backed by QPDF 12.4.2, Zoo builder 0.1.1, and the reviewed browser-full Release asset.
Install
npm install @wasm-zoo/qpdfUse
import { load } from "@wasm-zoo/qpdf";
const qpdf = await load();
try {
const result = await qpdf.exec(["/input.pdf", "/output.pdf", "--linearize"], {
files: [{ name: "/input.pdf", data: inputBytes }],
outputs: ["/output.pdf"]
});
console.log(result.files[0].data);
} finally {
qpdf.dispose();
}The default entry imports the reviewed browser wrapper and uses static new URL(..., import.meta.url) references so modern bundlers can emit qpdf-core.js, qpdf-core.wasm. For manual/self-hosted deployments use @wasm-zoo/qpdf/self-hosted and the Consumer API v1 baseUrl contract.
Single-threaded upstream qpdf CLI in an isolated Web Worker with MEMFS and QPDF native crypto. No SharedArrayBuffer is required. Inputs and outputs are explicitly staged in browser memory; there is no native host filesystem access.
