pdfextract API
    Preparing search index...

    Interface StructuredTextOptions

    Page selection, OCR policy and behavior when individual page or OCR-region operations fail.

    interface StructuredTextOptions {
        errorMode?: "throw" | "collect";
        ocr?: OcrMode;
        onProgress?: (event: ProgressEvent) => void;
        pages?: readonly number[];
        signal?: AbortSignal;
    }

    Hierarchy (View Summary)

    Index
    errorMode?: "throw" | "collect"

    throw rejects on failure (default); collect returns partial results with diagnostics.

    ocr?: OcrMode

    Defaults to auto when a provider was supplied, otherwise off. Explicit auto/always requires a provider.

    onProgress?: (event: ProgressEvent) => void

    Called during work. Keep callbacks lightweight and avoid throwing.

    pages?: readonly number[]

    One-based pages to extract; omitted means all pages.

    signal?: AbortSignal

    Aborts queued work promptly; a synchronous engine decode already running may finish before cleanup.