pdf-parse
    Preparing search index...

    Interface LoadParameters

    LoadParameters PDF loading parameters.

    interface LoadParameters {
        CanvasFactory?: Object;
        canvasMaxAreaInBytes?: number;
        cMapPacked?: boolean;
        CMapReaderFactory?: Object;
        cMapUrl?: string;
        data?: string | ArrayBuffer | number[] | TypedArray;
        disableAutoFetch?: boolean;
        disableFontFace?: boolean;
        disableRange?: boolean;
        disableStream?: boolean;
        docBaseUrl?: string;
        enableHWA?: boolean;
        enableXfa?: boolean;
        FilterFactory?: Object;
        fontExtraProperties?: boolean;
        httpHeaders?: Object;
        iccUrl?: string;
        isEvalSupported?: boolean;
        isImageDecoderSupported?: boolean;
        isOffscreenCanvasSupported?: boolean;
        length?: number;
        maxImageSize?: number;
        ownerDocument?: HTMLDocument;
        password?: string;
        pdfBug?: boolean;
        range?: PDFDataRangeTransport;
        rangeChunkSize?: number;
        StandardFontDataFactory?: Object;
        standardFontDataUrl?: string;
        stopAtErrors?: boolean;
        url?: string | URL;
        useSystemFonts?: boolean;
        useWasm?: boolean;
        useWorkerFetch?: boolean;
        verbosity?: number;
        WasmFactory?: Object;
        wasmUrl?: string;
        withCredentials?: boolean;
        worker?: PDFWorker;
    }

    Hierarchy

    • DocumentInitParameters
      • LoadParameters
    Index

    Properties

    CanvasFactory?: Object

    Factory for creating canvases. Default: {DOMCanvasFactory}.

    canvasMaxAreaInBytes?: number

    Used to determine when to resize images (via OffscreenCanvas). Use -1 to use a slower fallback algorithm. Default: undefined.

    cMapPacked?: boolean

    Specifies if Adobe CMaps are binary-packed. Default: true.

    CMapReaderFactory?: Object

    Factory for reading built-in CMap files. Default: {DOMCMapReaderFactory}.

    cMapUrl?: string

    URL where predefined Adobe CMaps are located. Include trailing slash. Default: undefined.

    data?: string | ArrayBuffer | number[] | TypedArray

    Binary PDF data. Use TypedArrays (e.g., Uint8Array) to improve memory usage. If PDF data is BASE64-encoded, use atob() to convert it to a binary string first. NOTE: If TypedArrays are used, they will generally be transferred to the worker thread, reducing main-thread memory usage but taking ownership of the array. Default: undefined.

    disableAutoFetch?: boolean

    Disable pre-fetching of PDF data. Requires disableStream: true to work fully. Default: false.

    disableFontFace?: boolean

    Disable @font-face/Font Loading API; use built-in glyph renderer instead. Default: false in browsers, true in Node.js.

    disableRange?: boolean

    Disable range requests for PDF loading. Default: false.

    disableStream?: boolean

    Disable streaming PDF data. Default: false.

    docBaseUrl?: string

    Base URL of the document, used to resolve relative URLs in annotations and outline items. Default: undefined.

    enableHWA?: boolean

    Enable hardware acceleration for rendering. Default: false.

    enableXfa?: boolean

    Render XFA forms if present. Default: false.

    FilterFactory?: Object

    Factory for creating SVG filters during rendering. Default: {DOMFilterFactory}.

    fontExtraProperties?: boolean

    Include extra (non-rendering) font properties when exporting font data from worker. Increases memory usage. Default: false.

    httpHeaders?: Object

    Basic authentication headers. Default: undefined.

    iccUrl?: string

    URL where predefined ICC profiles are located. Include trailing slash. Default: undefined.

    isEvalSupported?: boolean

    Whether evaluating strings as JS is allowed (for PDF function performance). Default: true.

    isImageDecoderSupported?: boolean

    Whether ImageDecoder can be used in worker. Default: true in browsers, false in Node.js. NOTE: Temporarily disabled in Chromium due to bugs:

    isOffscreenCanvasSupported?: boolean

    Whether OffscreenCanvas can be used in worker. Default: true in browsers, false in Node.js.

    length?: number

    The PDF file length. Used for progress reports and range requests. Default: undefined.

    maxImageSize?: number

    Max image size in total pixels (width * height). Use -1 for no limit. Default: -1.

    ownerDocument?: HTMLDocument

    Explicit document context for creating elements and loading resources. Defaults to current document. Default: undefined.

    password?: string

    For decrypting password-protected PDFs. Default: undefined.

    pdfBug?: boolean

    Enable debugging hooks (see web/debugger.js). Default: false.

    Allows using a custom range transport implementation. Default: undefined.

    rangeChunkSize?: number

    Maximum number of bytes fetched per range request. Default: 65536 (2^16).

    StandardFontDataFactory?: Object

    Factory for reading standard font files. Default: {DOMStandardFontDataFactory}.

    standardFontDataUrl?: string

    URL for standard font files. Include trailing slash. Default: undefined.

    stopAtErrors?: boolean

    Reject promises (e.g., getTextContent) on parse errors instead of recovering partially. Default: false.

    url?: string | URL

    The URL of the PDF. Default: undefined.

    useSystemFonts?: boolean

    If true, non-embedded fonts fall back to system fonts. Default: true in browsers, false in Node.js (unless disableFontFace === true, then always false).

    useWasm?: boolean

    Attempt to use WebAssembly for better performance (e.g., image decoding). Default: true.

    useWorkerFetch?: boolean

    Enable fetch() in worker thread for CMap/font/WASM files. If true, factory options are ignored. Default: true in browsers, false in Node.js.

    verbosity?: number

    Controls logging level; use constants from VerbosityLevel. Default: undefined.

    WasmFactory?: Object

    Factory for reading WASM files. Default: {DOMWasmFactory}.

    wasmUrl?: string

    URL for WebAssembly files. Include trailing slash. Default: undefined.

    withCredentials?: boolean

    Indicates whether cross-site Access-Control requests should be made using credentials (e.g., cookies or auth headers). Default: false.

    worker?: PDFWorker

    The worker used for loading and parsing PDF data. Default: undefined.