Interface: MarkdownOptions
Defined in: src/helpers/types.ts:134
Properties
detectOrientation?
optional detectOrientation?: boolean;Defined in: src/helpers/types.ts:179
With tableStrategy: "pixels", turn a page without a text layer whose lines run vertically (a sheet scanned sideways, /Rotate not set) before its tables are read. Default true.
dpi?
optional dpi?: number;Defined in: src/helpers/types.ts:149
elements?
optional elements?: MarkdownElement[];Defined in: src/helpers/types.ts:201
Whitelist of markdown elements to emit. When omitted, ALL elements are emitted (backwards-compatible default). When provided, only the listed elements are produced; everything else falls back to plain text.
Combines with the legacy toggles (ignoreCode, hdrInfo: false, tableStrategy: null, writeImages/embedImages): an element is emitted only if BOTH the whitelist allows it AND no legacy option disabled it.
embedImages?
optional embedImages?: boolean;Defined in: src/helpers/types.ts:141
explicitTableGrids?
optional explicitTableGrids?: object[];Defined in: src/helpers/types.ts:183
Explicit grid coordinates for tableStrategy: "explicit".
hLines
hLines: number[];vLines
vLines: number[];extractWords?
optional extractWords?: boolean;Defined in: src/helpers/types.ts:187
filename?
optional filename?: string | null;Defined in: src/helpers/types.ts:145
fontsizeLimit?
optional fontsizeLimit?: number;Defined in: src/helpers/types.ts:185
Skip spans whose font size is below this threshold (in pt). Mirrors upstream FONTSIZE_LIMIT.
forceText?
optional forceText?: boolean;Defined in: src/helpers/types.ts:146
hdrInfo?
optional hdrInfo?:
| false
| {
get_header_id: string;
}
| ((s) => string);Defined in: src/helpers/types.ts:136
ignoreAlpha?
optional ignoreAlpha?: boolean;Defined in: src/helpers/types.ts:190
Accept invisible (alpha=0) text. Currently a no-op — mupdf.js's walker does not expose alpha.
ignoreCode?
optional ignoreCode?: boolean;Defined in: src/helpers/types.ts:186
imageFormat?
optional imageFormat?: "png" | "jpg" | "jpeg";Defined in: src/helpers/types.ts:143
imagePath?
optional imagePath?: string;Defined in: src/helpers/types.ts:142
imageSizeLimit?
optional imageSizeLimit?: number;Defined in: src/helpers/types.ts:144
margins?
optional margins?:
| number
| [number, number]
| [number, number, number, number];Defined in: src/helpers/types.ts:148
ocr?
optional ocr?: OcrEngine;Defined in: src/helpers/types.ts:173
OCR engine for table cells. Defaults to RapidOCR (PP-OCRv5 via the optional peer dependencies ppu-paddle-ocr + onnxruntime-node), which is loaded on first use. Any object with recognize(image) works.
ocrDpi?
optional ocrDpi?: number;Defined in: src/helpers/types.ts:181
Resolution the page is rendered at for "pixels" and OCR. Default 300.
pages?
optional pages?: number[];Defined in: src/helpers/types.ts:135
pageSeparators?
optional pageSeparators?: boolean;Defined in: src/helpers/types.ts:147
removeRotation?
optional removeRotation?: boolean;Defined in: src/helpers/types.ts:191
showProgress?
optional showProgress?: boolean;Defined in: src/helpers/types.ts:188
tableStrategy?
optional tableStrategy?: "lines_strict" | "lines" | "text" | "explicit" | "pixels" | null;Defined in: src/helpers/types.ts:154
How tables are found. "pixels" finds ruling lines on the rendered page instead of in the PDF drawings, so it works on scans.
textSource?
optional textSource?: TextSource;Defined in: src/helpers/types.ts:167
Where table cell text comes from, independent of how the table was found:
"pdf": the PDF text layer."ocr": OCR of every cell; the text layer is ignored."auto"(default): the text layer, and OCR for cells whose text is empty or looks broken (replacement or private-use characters, a letter of another script slipped into a word, mostly symbols). On a page without a text layer that is every cell. Left at the default, a page with a text layer keeps it when no OCR engine can be set up.
The source of each cell is reported in PageChunk.tables[].cells.
writeImages?
optional writeImages?: boolean;Defined in: src/helpers/types.ts:140