NativePDFiumPage
Defined in: src/document/native-page.ts:66
A PDF page backed by the native PDFium addon.
Supports core operations: dimensions, text extraction, and rendering.
Extends
Section titled “Extends”Accessors
Section titled “Accessors”annotationCount
Section titled “annotationCount”Get Signature
Section titled “Get Signature”get annotationCount():
number
Defined in: src/document/native-page.ts:535
Get the number of annotations on this page.
Returns
Section titled “Returns”number
artBox
Section titled “artBox”Get Signature
Section titled “Get Signature”get artBox():
PageBox|undefined
Defined in: src/document/native-page.ts:521
Get the art box (content boundaries).
Returns
Section titled “Returns”PageBox | undefined
bleedBox
Section titled “bleedBox”Get Signature
Section titled “Get Signature”get bleedBox():
PageBox|undefined
Defined in: src/document/native-page.ts:511
Get the bleed box (printing bleed area).
Returns
Section titled “Returns”PageBox | undefined
charCount
Section titled “charCount”Get Signature
Section titled “Get Signature”get charCount():
number
Defined in: src/document/native-page.ts:146
Get the number of characters on the page.
Returns
Section titled “Returns”number
cropBox
Section titled “cropBox”Get Signature
Section titled “Get Signature”get cropBox():
PageBox|undefined
Defined in: src/document/native-page.ts:506
Get the crop box (visible region).
Returns
Section titled “Returns”PageBox | undefined
disposed
Section titled “disposed”Get Signature
Section titled “Get Signature”get disposed():
boolean
Defined in: src/core/disposable.ts:73
Whether this resource has been disposed.
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”height
Section titled “height”Get Signature
Section titled “Get Signature”get height():
number
Defined in: src/document/native-page.ts:119
Get the height of the page in points.
Returns
Section titled “Returns”number
Get Signature
Section titled “Get Signature”get index():
number
Defined in: src/document/native-page.ts:102
The zero-based index of this page.
Returns
Section titled “Returns”number
mediaBox
Section titled “mediaBox”Get Signature
Section titled “Get Signature”get mediaBox():
PageBox|undefined
Defined in: src/document/native-page.ts:501
Get the media box (physical page boundaries).
Returns
Section titled “Returns”PageBox | undefined
rotation
Section titled “rotation”Get Signature
Section titled “Get Signature”get rotation():
PageRotation
Defined in: src/document/native-page.ts:410
Get the page rotation (0=0deg, 1=90deg, 2=180deg, 3=270deg).
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”get size():
object
Defined in: src/document/native-page.ts:107
Get the page dimensions in points.
Returns
Section titled “Returns”object
| Name | Type | Defined in |
|---|---|---|
height | number | src/document/native-page.ts:107 |
width | number | src/document/native-page.ts:107 |
trimBox
Section titled “trimBox”Get Signature
Section titled “Get Signature”get trimBox():
PageBox|undefined
Defined in: src/document/native-page.ts:516
Get the trim box (final trimmed dimensions).
Returns
Section titled “Returns”PageBox | undefined
Get Signature
Section titled “Get Signature”get width():
number
Defined in: src/document/native-page.ts:113
Get the width of the page in points.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”[dispose]()
Section titled “[dispose]()”[dispose]():
void
Defined in: src/core/disposable.ts:148
Dispose of this resource, freeing WASM memory.
This method is idempotent - calling it multiple times has no effect after the first call.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”appendAnnotationAttachmentPoints()
Section titled “appendAnnotationAttachmentPoints()”appendAnnotationAttachmentPoints(
index,points):boolean
Defined in: src/document/native-page.ts:664
Append attachment points to an annotation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
index | number |
points | QuadPoints |
Returns
Section titled “Returns”boolean
true if the points were appended.
createAnnotation()
Section titled “createAnnotation()”createAnnotation(
subtype):number
Defined in: src/document/native-page.ts:546
Create a new annotation on this page.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
subtype | AnnotationType | Annotation subtype (e.g. AnnotationType.Text = 1). |
Returns
Section titled “Returns”number
The index of the new annotation.
deviceToPage()
Section titled “deviceToPage()”deviceToPage(
context,deviceX,deviceY):PageCoordinate
Defined in: src/document/native-page.ts:440
Convert device coordinates to page coordinates.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | CoordinateTransformContext |
deviceX | number |
deviceY | number |
Returns
Section titled “Returns”dispose()
Section titled “dispose()”dispose():
void
Defined in: src/core/disposable.ts:164
Alias for Symbol.dispose for explicit calls.
Returns
Section titled “Returns”void
Example
Section titled “Example”document.dispose();Inherited from
Section titled “Inherited from”findText()
Section titled “findText()”findText(
query,flags):IterableIterator<TextSearchResult>
Defined in: src/document/native-page.ts:386
Find all occurrences of a string on the page.
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
query | string | undefined |
flags | TextSearchFlags | TextSearchFlags.None |
Returns
Section titled “Returns”IterableIterator<TextSearchResult>
flatten()
Section titled “flatten()”flatten(
flags):FlattenResult
Defined in: src/document/native-page.ts:422
Flatten annotations and form fields into page content.
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
flags | FlattenFlags | FlattenFlags.NormalDisplay |
Returns
Section titled “Returns”generateContent()
Section titled “generateContent()”generateContent():
boolean
Defined in: src/document/native-page.ts:432
Generate the page content stream after modifications.
Returns
Section titled “Returns”boolean
getAnnotationFlags()
Section titled “getAnnotationFlags()”getAnnotationFlags(
index):number
Defined in: src/document/native-page.ts:600
Get the flags of an annotation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
index | number |
Returns
Section titled “Returns”number
getAnnotations()
Section titled “getAnnotations()”getAnnotations():
Annotation[]
Defined in: src/document/native-page.ts:528
Get all annotations on this page.
Returns
Section titled “Returns”getBoundedText()
Section titled “getBoundedText()”getBoundedText(
left,top,right,bottom):string
Defined in: src/document/native-page.ts:401
Get text within a bounding rectangle.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
left | number |
top | number |
right | number |
bottom | number |
Returns
Section titled “Returns”string
getCharAngle()
Section titled “getCharAngle()”getCharAngle(
charIndex):number
Defined in: src/document/native-page.ts:284
Get the rotation angle (in radians) of a character.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”number
getCharBox()
Section titled “getCharBox()”getCharBox(
charIndex):CharBox|undefined
Defined in: src/document/native-page.ts:306
Get the bounding box of a character.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”CharBox | undefined
getCharFillColour()
Section titled “getCharFillColour()”getCharFillColour(
charIndex):Colour|undefined
Defined in: src/document/native-page.ts:340
Get the fill colour of a character.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”Colour | undefined
getCharFontName()
Section titled “getCharFontName()”getCharFontName(
charIndex):string|undefined
Defined in: src/document/native-page.ts:210
Get the font name of a character at the specified index.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”string | undefined
getCharFontSize()
Section titled “getCharFontSize()”getCharFontSize(
charIndex):number
Defined in: src/document/native-page.ts:184
Get the font size of a character at the specified index.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”number
getCharFontWeight()
Section titled “getCharFontWeight()”getCharFontWeight(
charIndex):number
Defined in: src/document/native-page.ts:197
Get the font weight of a character at the specified index.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”number
getCharIndexAtPos()
Section titled “getCharIndexAtPos()”getCharIndexAtPos(
x,y,xTolerance,yTolerance):number
Defined in: src/document/native-page.ts:328
Get the character index at a page position. Returns -1 if not found.
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
x | number | undefined |
y | number | undefined |
xTolerance | number | DEFAULT_CHAR_POSITION_TOLERANCE |
yTolerance | number | DEFAULT_CHAR_POSITION_TOLERANCE |
Returns
Section titled “Returns”number
getCharLooseBox()
Section titled “getCharLooseBox()”getCharLooseBox(
charIndex):Rect|undefined
Defined in: src/document/native-page.ts:317
Get the loose bounding box of a character.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”Rect | undefined
getCharMatrix()
Section titled “getCharMatrix()”getCharMatrix(
charIndex):TransformMatrix|undefined
Defined in: src/document/native-page.ts:362
Get the transformation matrix of a character.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”TransformMatrix | undefined
getCharOrigin()
Section titled “getCharOrigin()”getCharOrigin(
charIndex): {x:number;y:number; } |undefined
Defined in: src/document/native-page.ts:295
Get the origin point of a character.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”{ x: number; y: number; } | undefined
getCharRenderMode()
Section titled “getCharRenderMode()”getCharRenderMode(
charIndex):TextRenderMode
Defined in: src/document/native-page.ts:224
Get the text render mode for a character at the specified index.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”getCharStrokeColour()
Section titled “getCharStrokeColour()”getCharStrokeColour(
charIndex):Colour|undefined
Defined in: src/document/native-page.ts:351
Get the stroke colour of a character.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”Colour | undefined
getCharUnicode()
Section titled “getCharUnicode()”getCharUnicode(
charIndex):number
Defined in: src/document/native-page.ts:240
Get the Unicode codepoint of a character.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”number
getLinks()
Section titled “getLinks()”getLinks():
PDFLink[]
Defined in: src/document/native-page.ts:693
Get all links on this page.
Returns
Section titled “Returns”PDFLink[]
getPageBox()
Section titled “getPageBox()”getPageBox(
boxType):PageBox|undefined
Defined in: src/document/native-page.ts:478
Get a specific page box by type.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
boxType | PageBoxType |
Returns
Section titled “Returns”PageBox | undefined
getText()
Section titled “getText()”getText():
string
Defined in: src/document/native-page.ts:125
Get all text content from the page.
Returns
Section titled “Returns”string
hasCharUnicodeMapError()
Section titled “hasCharUnicodeMapError()”hasCharUnicodeMapError(
charIndex):boolean
Defined in: src/document/native-page.ts:273
Check if a character has a Unicode mapping error.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”boolean
hasTransparency()
Section titled “hasTransparency()”hasTransparency():
boolean
Defined in: src/document/native-page.ts:416
Check if this page contains transparency.
Returns
Section titled “Returns”boolean
isCharGenerated()
Section titled “isCharGenerated()”isCharGenerated(
charIndex):boolean
Defined in: src/document/native-page.ts:251
Check if a character is generated (not from the original PDF content).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”boolean
isCharHyphen()
Section titled “isCharHyphen()”isCharHyphen(
charIndex):boolean
Defined in: src/document/native-page.ts:262
Check if a character is a hyphen.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
charIndex | number |
Returns
Section titled “Returns”boolean
pageToDevice()
Section titled “pageToDevice()”pageToDevice(
context,pageX,pageY):DeviceCoordinate
Defined in: src/document/native-page.ts:458
Convert page coordinates to device coordinates.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | CoordinateTransformContext |
pageX | number |
pageY | number |
Returns
Section titled “Returns”removeAnnotation()
Section titled “removeAnnotation()”removeAnnotation(
index):boolean
Defined in: src/document/native-page.ts:556
Remove an annotation by index.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
index | number |
Returns
Section titled “Returns”boolean
true if the annotation was removed.
render()
Section titled “render()”render(
options):RenderResult
Defined in: src/document/native-page.ts:153
Render the page to a bitmap.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options | RenderOptions |
Returns
Section titled “Returns”setAnnotationAttachmentPoints()
Section titled “setAnnotationAttachmentPoints()”setAnnotationAttachmentPoints(
index,quadIndex,points):boolean
Defined in: src/document/native-page.ts:642
Set attachment points at a specific quad index.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
index | number |
quadIndex | number |
points | QuadPoints |
Returns
Section titled “Returns”boolean
true if the points were set.
setAnnotationBorder()
Section titled “setAnnotationBorder()”setAnnotationBorder(
index,horizontalRadius,verticalRadius,borderWidth):boolean
Defined in: src/document/native-page.ts:632
Set the border of an annotation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
index | number |
horizontalRadius | number |
verticalRadius | number |
borderWidth | number |
Returns
Section titled “Returns”boolean
true if the border was set.
setAnnotationColour()
Section titled “setAnnotationColour()”setAnnotationColour(
index,colour,colourType):boolean
Defined in: src/document/native-page.ts:584
Set the colour of an annotation.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
index | number | undefined | - |
colour | Colour | undefined | - |
colourType | number | 0 | 0 for colour, 1 for interior colour. |
Returns
Section titled “Returns”boolean
true if the colour was set.
setAnnotationFlags()
Section titled “setAnnotationFlags()”setAnnotationFlags(
index,flags):boolean
Defined in: src/document/native-page.ts:610
Set the flags of an annotation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
index | number |
flags | number |
Returns
Section titled “Returns”boolean
true if the flags were set.
setAnnotationRect()
Section titled “setAnnotationRect()”setAnnotationRect(
index,bounds):boolean
Defined in: src/document/native-page.ts:566
Set the bounding rectangle of an annotation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
index | number |
bounds | PageBox |
Returns
Section titled “Returns”boolean
true if the rect was set.
setAnnotationStringValue()
Section titled “setAnnotationStringValue()”setAnnotationStringValue(
index,key,value):boolean
Defined in: src/document/native-page.ts:622
Set a string value on an annotation.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
index | number | - |
key | string | The dictionary key (e.g. “Contents”). |
value | string | The string value. |
Returns
Section titled “Returns”boolean
true if the value was set.
setAnnotationUri()
Section titled “setAnnotationUri()”setAnnotationUri(
index,uri):boolean
Defined in: src/document/native-page.ts:685
Set the URI on a link annotation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
index | number |
uri | string |
Returns
Section titled “Returns”boolean
true if the URI was set.
setPageBox()
Section titled “setPageBox()”setPageBox(
boxType,box):void
Defined in: src/document/native-page.ts:488
Set a specific page box by type.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
boxType | PageBoxType |
box | PageBox |
Returns
Section titled “Returns”void