These docs describe changes that aren’t released yet. For the newest release, see the released docs.
PageRef
A page of a Document, held by its ID: moving pages doesn’t retarget it (ADR 0028 F2).
Freed with its document; every call after that throws disposed.
Extends
Section titled “Extends”Handle<BaseGlue>
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get id():
string
The page’s stable ID (p12.0).
Returns
Section titled “Returns”string
Get Signature
Section titled “Get Signature”get index():
number
The page’s current 0-based index.
Throws
Section titled “Throws”LaminaPdfError unknown-page when it is gone.
Returns
Section titled “Returns”number
Get Signature
Section titled “Get Signature”get info():
PageInfoJs
The page’s facts now.
Throws
Section titled “Throws”LaminaPdfError unknown-page when it is gone.
Returns
Section titled “Returns”PageInfoJs
Methods
Section titled “Methods”[dispose]()
Section titled “[dispose]()”[dispose]():
void
Frees the handle at the end of a using block (an alias of free()).
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Handle.[dispose]
free()
Section titled “free()”free():
void
Frees the handle’s memory now; without it, the garbage collector frees it later. A second
call does nothing, and any other call afterwards throws disposed. Prefer using, which
calls this at the end of the block.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Handle.free
text()
Section titled “text()”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.
Parameters
Section titled “Parameters”options?
Section titled “options?”skipInvisible leaves out invisible text (OCR layers).
Returns
Section titled “Returns”Example
Section titled “Example”await init({ extract: true });const doc = Document.open(bytes);const text = doc.page(0).text().text();Throws
Section titled “Throws”LaminaPdfError extract-module-not-loaded for a document opened in the base
module; unknown-page; reading errors (data-pending for a range document: use ensure).