Creates an engine whose documents share one lazily initialized worker.
Worker asset locations, factories, and host-specific configuration.
Registers font data used to substitute missing fonts, then re-render affected pages.
The face value (string).
The input data.
OptionalresolvedFace: string
The resolvedFace value (string).
The resulting Promise.
Creates a new empty document.
The sourceName value (string).
The resulting Promise.
Terminates the worker; all documents opened by this engine become unusable.
Spawns the worker and initializes the engine. Called implicitly by the open functions.
The resulting Promise.
Opens a document from in-memory PDF bytes.
Ownership of a full ArrayBuffer (or a full Uint8Array view) is
transferred to the worker, detaching it from the caller. Partial views are
first copied into a tightly sized buffer and that copy is transferred.
Password retries reuse the worker-owned bytes and transfer only the new
password.
The input data.
Options that customize the operation.
The resolved Promise.
Opens a document by URL. The worker fetches the bytes, so the URL must be
reachable under the page's CORS policy; relative URLs are resolved against
WorkerCommunicatorOptions.baseUrl (document.baseURI by default).
Set PdfOpenUrlOptions.preferRangeAccess to stream the file via range
requests.
The URL to use.
Options that customize the operation.
The resolved Promise.
Re-applies registered font data across the worker (e.g. after adding fonts).
The resulting Promise.
Entry point to the rendering engine.
Construct one — in a browser, with the URL of the directory serving the bundled WASM assets; on Node, Bun or Deno, with nothing at all, since the assets ship inside this package — then open documents with openUrl, openData or createNew. A single engine owns one worker shared by all documents it opens; call dispose to tear it down.
Example