Skip to content

PageRef

A page of a Document, held by its ID: moving pages doesn’t retarget it (ADR 0028 F2).

get id(): string

The page’s stable ID (p12.0).

string


get index(): number

The page’s current 0-based index.

LaminaError unknown-page when it is gone.

number


get info(): PageInfoJs

The page’s facts now.

LaminaError unknown-page when it is gone.

PageInfoJs

text(options?): PageText

The page’s text: lines in reading order, runs, and every glyph’s quad in page space. Needs a document opened while the extract or text module was loaded.

PageTextOptions

skipInvisible leaves out invisible text (OCR layers).

PageText

await init({ extract: true });
const doc = Document.open(bytes);
const text = doc.page(0).text().text();

LaminaError extract-module-not-loaded for a document opened in the base module; unknown-page; reading errors (data-pending for a range document: use ensure).