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";
        math?: "text" | "latex";
        minOcrConfidence?: number;
        ocr?: OcrMode;
        onProgress?: (event: ProgressEvent) => void;
        pages?: readonly number[];
        signal?: AbortSignal;
        tables?: boolean;
    }

    Hierarchy (View Summary)

    Index
    errorMode?: "throw" | "collect"

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

    math?: "text" | "latex"

    Math on pages typeset with TeX. latex rebuilds formulas from their glyphs (math fonts, sub- and superscripts, fractions, roots, accents) and puts them in the text as $…$ LaTeX, for Markdown and other math-aware consumers; text (default) keeps the glyphs' Unicode text. Pages without TeX math fonts are unaffected; latex costs one more glyph scan on pages with them.

    minOcrConfidence?: number

    Recognized words with a provider confidence below this value are dropped, which removes most noise from photos and graphics. Range 0–1; default 0.3; 0 keeps every word.

    ocr?: OcrMode

    Defaults to auto when a provider was supplied, otherwise off. Explicit auto/always requires a provider. Auto recognizes embedded images, and renders the whole page instead when a page has no native text but is drawn with many vector shapes (outlined lettering).

    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.

    tables?: boolean

    Detect tables from ruling lines and aligned text columns (default true). Detected tables are returned in TextPage.tables and read row by row in the text. false skips detection and the extra vector-graphics scan it needs on pages with column-like text.