Skip to content

Interface: MarkdownOptions ​

Defined in: src/helpers/types.ts:134

Properties ​

detectOrientation? ​

ts
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? ​

ts
optional dpi?: number;

Defined in: src/helpers/types.ts:149


elements? ​

ts
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? ​

ts
optional embedImages?: boolean;

Defined in: src/helpers/types.ts:141


explicitTableGrids? ​

ts
optional explicitTableGrids?: object[];

Defined in: src/helpers/types.ts:183

Explicit grid coordinates for tableStrategy: "explicit".

hLines ​

ts
hLines: number[];

vLines ​

ts
vLines: number[];

extractWords? ​

ts
optional extractWords?: boolean;

Defined in: src/helpers/types.ts:187


filename? ​

ts
optional filename?: string | null;

Defined in: src/helpers/types.ts:145


fontsizeLimit? ​

ts
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? ​

ts
optional forceText?: boolean;

Defined in: src/helpers/types.ts:146


hdrInfo? ​

ts
optional hdrInfo?: 
  | false
  | {
  get_header_id: string;
}
  | ((s) => string);

Defined in: src/helpers/types.ts:136


ignoreAlpha? ​

ts
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? ​

ts
optional ignoreCode?: boolean;

Defined in: src/helpers/types.ts:186


imageFormat? ​

ts
optional imageFormat?: "png" | "jpg" | "jpeg";

Defined in: src/helpers/types.ts:143


imagePath? ​

ts
optional imagePath?: string;

Defined in: src/helpers/types.ts:142


imageSizeLimit? ​

ts
optional imageSizeLimit?: number;

Defined in: src/helpers/types.ts:144


margins? ​

ts
optional margins?: 
  | number
  | [number, number]
  | [number, number, number, number];

Defined in: src/helpers/types.ts:148


ocr? ​

ts
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? ​

ts
optional ocrDpi?: number;

Defined in: src/helpers/types.ts:181

Resolution the page is rendered at for "pixels" and OCR. Default 300.


pages? ​

ts
optional pages?: number[];

Defined in: src/helpers/types.ts:135


pageSeparators? ​

ts
optional pageSeparators?: boolean;

Defined in: src/helpers/types.ts:147


removeRotation? ​

ts
optional removeRotation?: boolean;

Defined in: src/helpers/types.ts:191


showProgress? ​

ts
optional showProgress?: boolean;

Defined in: src/helpers/types.ts:188


tableStrategy? ​

ts
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? ​

ts
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? ​

ts
optional writeImages?: boolean;

Defined in: src/helpers/types.ts:140

AGPL-3.0-or-later — inherited from PyMuPDF and pymupdf4llm.