pdfextract API
    Preparing search index...

    Interface OcrRaster

    Owned RGBA8 working raster passed to an OCR provider. Provider geometry must refer to these input pixels.

    interface OcrRaster {
        data: Uint8Array<ArrayBuffer>;
        dpi?: number;
        format: "rgba8";
        height: number;
        layout?: "sparse";
        stride: number;
        width: number;
    }
    Index
    data: Uint8Array<ArrayBuffer>

    RGBA bytes owned independently of caller PDF input and engine memory.

    dpi?: number

    Effective resolution in pixels per inch, as the raster appears on the page, when known. Core sets it for page renders and image regions; providers may use it to tune recognition.

    format: "rgba8"

    Eight-bit red/green/blue/alpha channel order.

    height: number

    Input raster height in pixels.

    layout?: "sparse"

    sparse when the raster holds scattered words (handwriting, forms, labels) rather than blocks of text, as core asks when a page yielded no text otherwise; recognizers may use a sparse-text mode for it or ignore it.

    stride: number

    Bytes per row; the bundled Tesseract provider requires width × 4.

    width: number

    Input raster width in pixels.