pdfrx_web
    Preparing search index...

    Interface PdfrxEngineOptions

    Options for constructing a PdfrxEngine.

    interface PdfrxEngineOptions {
        baseUrl?: string;
        createWorker?: (
            urls: PdfWorkerUrls,
        ) => PdfWorkerLike | Promise<PdfWorkerLike>;
        fontCache?: PdfrxFontCacheOptions;
        headers?: Record<string, string>;
        localFonts?: PdfrxLocalFontsOptions;
        wasmModulesUrl?: string;
        withCredentials?: boolean;
    }

    Hierarchy

    • WorkerCommunicatorOptions
      • PdfrxEngineOptions
    Index
    baseUrl?: string

    What relative URLs — wasmModulesUrl and the ones passed to PdfrxEngine.openUrl — resolve against. Defaults to document.baseURI in a browser and to the current working directory elsewhere.

    createWorker?: (urls: PdfWorkerUrls) => PdfWorkerLike | Promise<PdfWorkerLike>

    Escape hatch for starting the worker yourself, for a host the engine does not already know (it handles browsers, Node, Bun and Deno on its own) or one that needs its worker configured — permissions, resource limits, a self-hosted copy of pdfium_worker.js. Return anything that behaves like a Web Worker; see PdfWorkerLike and PdfWorkerUrls.

    Optional disk cache for local-font metadata and explicitly registered font bytes.

    headers?: Record<string, string>

    Extra headers sent when the worker fetches pdfium.wasm.

    Discover and lazily register fonts from server-runtime filesystems. Omit this in browsers and to retain the previous no-filesystem behavior.

    wasmModulesUrl?: string

    Base URL of the directory that contains pdfium_worker.js and pdfium.wasm, resolved against baseUrl when relative.

    Required in a browser, where those files have to be served. Everywhere else it defaults to the assets/ directory shipped inside this package, so there is nothing to pass — unless the package's files are not on disk as published (a bundled server build, say), in which case point this at wherever they went.

    withCredentials?: boolean

    Whether the worker's pdfium.wasm fetch includes credentials.