@squidcloud/client
    Preparing search index...

    Interface ExtractDataFromDocumentOptions

    Options for customizing how data is extracted from a document.

    interface ExtractDataFromDocumentOptions {
        collectDocumentMetadata?: boolean;
        discardOriginalFile?: boolean;
        extractImages?: boolean;
        imageMinSizePixels?: number;
        pageIndexes?: number[];
        preferredExtractionMethod?: DocumentExtractionMethod;
        textFormat?: "auto" | "markdown" | "html" | "plain";
    }
    Index
    collectDocumentMetadata?: boolean

    Whether to read document-level properties (title/author/dates) from the source container and return them as documentMetadata. Off by default: container parsing has a real per-file cost (zip/PDF re-parse), so callers opt in only when the owning knowledge base declares metadata fields.

    Honored only by file-based extraction (which owns the original buffer for every format); URL-based extraction ignores it and never returns documentMetadata.

    discardOriginalFile?: boolean

    Whether Squid keeps or discards the original file.

    Keeping the original file allows reprocessing and the ability for the user to download it later.

    Defaults to false.

    extractImages?: boolean

    Whether to extract embedded images from the document. Defaults to true.

    imageMinSizePixels?: number

    Minimum width/height (in pixels) of images to extract. Smaller images will be ignored.

    pageIndexes?: number[]

    Specific page indexes to extract from the document (0-based whole numbers). If omitted or empty, all pages are extracted. Duplicates are collapsed, order does not matter, and a selection containing no whole page number at all is rejected.

    An index past the end of the document is ignored, and a selection naming only such indexes is rejected — but only where the document is read here. Extracting a PDF by URL through an OCR provider hands it over without reading it, so its length is unknown and what an out-of-range index does is up to that provider. Upload the file instead to have the whole selection checked.

    preferredExtractionMethod?: DocumentExtractionMethod

    The preferred method for extracting data from the document.

    textFormat?: "auto" | "markdown" | "html" | "plain"

    Format hint for text-based extraction (markdown / HTML). When omitted, the format is detected from the content. Only consulted by extractors that handle text input.