Interface OfficeLoaderOptions

Options of the office loader.

interface OfficeLoaderOptions {
    maxInflatedBytes?: number;
    maxXmlElements?: number;
    maxTableCells?: number;
    ocrPages?: number;
    pdfProcessMemoryMb?: number;
    parse?: OfficeParse;
}

Properties

maxInflatedBytes?: number

The most the parts officeparser reads from an archive may inflate to, together, counted as they inflate. Default 67,108,864 (64 MiB).

maxXmlElements?: number

The most XML elements read from a document's parts, an EPUB's chapters included. An .xlsx workbook's sheets are read without building elements, and their cells count toward maxTableCells alone; an .ods file's sheets are XML, and count toward both. officeparser's own default when left out.

maxTableCells?: number

The most cells an .xlsx workbook's sheets, and an OpenDocument file's sheets and tables, may hold. officeparser counts no other format's cells: a .pptx or .epub table's cells are XML elements, which maxXmlElements bounds, and none of the loader's three bounds counts an .rtf file's. officeparser allows a document one more cell for each byte of its file; the loader takes that allowance out of the limit it passes, so this is the bound itself. officeparser's own default, with its allowance, when left out.

ocrPages?: number

Pages of a scanned PDF read by OCR, from the first: a whole number; 0 refuses a PDF. Default 0.

pdfProcessMemoryMb?: number

The heap, in MB, of the separate process pdf.js runs in while a scan is read: 64 or more. Default 256. A scan whose pdf.js would run in the reading thread instead, outside this cap, is refused.

parse?: OfficeParse

officeparser's parseOffice. Given, every read calls it in the thread that calls load, a scan read by OCR included. Left out, officeparser is imported on the first read, and a scan is read in a worker thread of its own.