The loader's options; with none, an archive is bounded at 64 MiB inflated and a PDF is refused.
When a bound is not a positive, finite number, ocrPages is not a whole number of 0 or
more, or pdfProcessMemoryMb is under 64.
True for a file name with one of the loader's extensions. A buffer does
not say its format, so the answer for one is false; load reads it under
the format its caller names.
A file name or path, or a document's bytes.
Reads a document's bytes under the format its caller names.
The file's bytes. A path is refused: the loader reads no file.
Optional options: OfficeLoadOptionsformat names the document's format: a value of OFFICE_TYPES, with or without a
leading dot, or pdf for a scanned PDF. signal cancels this read.
The document's text, with metadata.wordCount, and metadata.pageCount when officeparser reports
a page count.
When the document reaches a bound, one officeparser only warns of included.
The error's limit is the loader's maxInflatedBytes whichever bound was reached, and its cause names
the bound by officeparser's code. So does its message, but past maxInflatedBytes, where the message
gives that bound in bytes.
For a PDF while ocrPages is 0, and for a scan whose pages gave no text. When
officeparser reported a picture OCR could not read, the first such failure is the error's cause.
The reason of options.signal when the caller aborts it.
When source is a path, when options.format names none of the formats, when officeparser
is not installed, and when a scan's pdf.js would run in the reading thread; the error a scan's worker
thread ended on, and loadIsolated's refusals of a scan's worker; and officeparser's own error for a file
it cannot read.
Readonly supportedFile extensions this loader handles, each with a leading dot.
Used by LoaderRegistry to route file paths to the correct loader.
['.md', '.mdx']
Document loader for PowerPoint (
.pptx), Excel (.xlsx), OpenDocument (.odt,.ods,.odp), RTF (.rtf) and EPUB (.epub) files, read in memory through officeparser, which is imported on the first read.The loader reads bytes under the format its caller names: it reads no file from a path and does not guess a format from the bytes. The text is the document's as officeparser writes it, without its comments and without its pictures.
With OfficeLoaderOptions.ocrPages above 0,
load(bytes, { format: 'pdf' })reads a scanned PDF in a worker thread of its own (loadIsolated's kind'scan'): officeparser reads the firstocrPagespages with pdf.js, in a process of its own capped atpdfProcessMemoryMb, and tesseract.js recognizes the text of each picture on them. A picture OCR could not read is left out of the text, and the read goes on. A failure tesseract.js throws outside officeparser's promise ends the worker thread, and the read rejects with it.Implements
Example: An uploaded deck, refused past its bounds
Example: A scanned PDF, its first three pages read by OCR