ReadonlybaseThe real page this one stands in for, or null if this is a real page.
ReadonlydocumentDocument whose current arrangement contains this page.
For an imported page this differs from sourceDocument, which owns the physical PDF page and its annotations and form widgets.
ReadonlyheightPage height in points (1/72 inch), at this page's rotation.
ReadonlyidOpaque logical-page identity. Placement and rotation proxies retain it; duplicate creates a distinct identity without copying PDF data.
ReadonlyisFalse for pages not yet materialized during progressive loading.
Readonlypage1-based page number — the position in PdfDocument.pages, not in the PDF.
ReadonlyrotationEffective page rotation (clockwise); on a rotated proxy this differs from the rotation baked into the PDF.
ReadonlysourceThe document holding the physical page this one draws.
Readonly InternalsourceReserved for internal use only. 0-based index of the physical page within sourceDocument.
Readonly InternalsourceReserved for internal use only. Rotation baked into the PDF for the physical page.
ReadonlywidthPage width in points (1/72 inch), at this page's rotation.
Whether this page is a proxy over basePage rather than a real page.
Identity of the physical page, independent of where it sits in the document. Two pages with the same key produce the same text and links.
Adds an annotation to this page and returns its id.
The id is stored in the PDF annotation dictionary's /NM ("annotation
name") entry. /NM is a PDF-standard string intended to distinguish an
annotation from the other annotations on the same page; it is not the
visible annotation text or the page number. The engine generates one when
PdfAnnotationSpec.id is omitted. Keep the returned value to pass to
updateAnnotation or removeAnnotation, or to correlate the
annotation with another representation. It is preserved when the PDF is
encoded and opened again.
The physical write is sent to sourceDocument; the
annotationsChanged event is emitted from the source document and every
open arrangement that places that source page. Duplicate placements share
annotation state and all of their page numbers are reported as affected.
The spec value (PdfAnnotationSpec).
Optionaloptions: PdfAnnotationMutationOptions
Options that customize the operation.
The resulting Promise.
Internal
Converts an annotation spec (bbox-relative page coords) to the wire form (raw page coords) the worker's create/replace commands expect.
Creates a token that cancels a render that has not started yet,
making it resolve to null. Use one per render call.
The resulting PdfPageRenderCancellationToken.
Creates an immutable destination for this logical page or its current 1-based position.
An ID-based destination is ambiguous when the same page identity occurs in multiple arrangement slots. Use duplicate when destinations must distinguish repeated placements; see that method for examples and details.
Options that customize the operation.
The resulting PdfDest.
Returns a lightweight proxy over the same physical page with a new logical identity. No PDF data is copied or materialized, so this operation is effectively free. The returned page still renders the same physical page; only placement identity is separated.
This matters when one PdfPage is placed more than once. Reusing the same object also reuses its opaque id, so an ID-based dest can identify the page but not a particular occurrence:
const [page, ...rest] = document.pages;
document.setPages([page!, ...rest, page!]);
const ambiguous = page!.dest({
by: 'id',
command: 'fit',
params: [],
});
// Both placements have the same ID. Following `ambiguous` selects one
// matching placement; callers must not rely on which one is selected.
Call duplicate() before arranging the second occurrence when destinations
must distinguish them:
const [page, ...rest] = document.pages;
const secondPlacement = page!.duplicate();
document.setPages([page!, ...rest, secondPlacement]);
const firstDest = page!.dest({
by: 'id',
command: 'fit',
params: [],
});
const secondDest = secondPlacement.dest({
by: 'id',
command: 'fit',
params: [],
});
The two destinations now follow separate placements, while both pages continue to use the same underlying PDF page data.
The resulting PdfPage.
Whether other draws the same physical page of the same PDF, regardless of
page number or rotation. Useful for keying caches by content.
The other value (PdfPage).
Whether the condition is satisfied.
Loads the editable annotations on this page (including Link annotations, but not widgets/popups), with rects and geometry in bounding-box-relative page coordinates (like loadLinks). Returns an empty array if the document is disposed or the page is not yet loaded.
Optionaloptions: PdfLoadAnnotationsOptions
Options that customize the operation.
The resolved Promise.
Internal
Returns the complete writable Link-annotation list for CRUD.
Loads the AcroForm fields whose widgets sit on this page, grouped by fully-qualified name. Rects are in PDF page coordinates (bounding-box relative, like loadLinks). Returns an empty array if the document is disposed, has no form, or the page is not yet loaded.
The resolved Promise.
Loads highlight annotations on this page. Unlike
PdfDocument.loadHighlights, this performs no document-wide scan.
With includeText, only this page's text is loaded and intersected with the
highlight quadpoints.
Optionaloptions: PdfLoadHighlightsOptions
Options that customize the operation.
The resolved Promise.
Loads link annotations on the page and, when
enableAutoLinkDetection is true (the default), URL-like text detected in
the page content. Pending annotation-CRUD changes are returned instead of
physical Link annotations while retaining transient detected URLs.
Optionaloptions: { enableAutoLinkDetection?: boolean }
Options that customize the operation.
The resolved Promise.
Loads the full text of the page with one bounding rect per UTF-16 code unit
(in page coordinates). Returns null if the document is disposed or the
page is not yet loaded (progressive loading).
The resolved Promise.
Internal
Returns a placement proxy owned by document.
Optionalid: PdfPageIdRemoves the annotation identified by id; returns whether it was found.
The PdfAnnotationObject.id returned by
loadAnnotations, or the id returned by addAnnotation.
This is normally the annotation dictionary's stable /NM ("annotation
name") value, a PDF-standard string used to distinguish annotations on
the page.
For an existing annotation without /NM, loadAnnotations() returns a
page-local @<index> fallback instead. Such a fallback is positional,
so use it before any other annotation is added, removed, or replaced on
this page; otherwise load the annotations again and use the new id.
Optionaloptions: PdfAnnotationMutationOptions
Options that customize the operation.
The resulting Promise.
Renders (a part of) the page to a PdfImage of RGBA8888 pixels (Canvas/WebGL-ready; the worker converts from the engine's native BGRA).
The page is scaled to fullWidth x fullHeight (defaulting to the page
size in points, i.e. 72 dpi) and the x/y/width/height sub-region of
that scaled page is returned. Use PdfImage.toImageData /
PdfImage.toImageBitmap to draw the result. Returns null if the
document is already disposed, or if
PdfPageRenderOptions.cancellationToken was cancelled.
Renders are queued (one in the worker at a time by default) rather than all posted at once, so a render that is no longer wanted can be dropped before it starts — see createCancellationToken.
Optionaloptions: PdfPageRenderOptions
Options that customize the operation.
The rendered Promise.
Creates a page-placement proxy rotated 180 degrees relative to this page.
Calling this method does not change PdfDocument.pages. Apply the result with PdfDocument.setPage or PdfDocument.setPages.
The resulting PdfPage.
Creates a page-placement proxy rotated clockwise by delta relative to its
current rotation property.
This does not modify the document by itself. Apply the returned proxy with PdfDocument.setPage or PdfDocument.setPages; use PdfDocument.encodePdf or PdfDocument.materialize only when the in-memory arrangement must be written into the physical PDF.
The amount of change to apply.
The resulting PdfPage.
Creates a page-placement proxy rotated 90 degrees counter-clockwise relative to this page.
Calling this method does not change PdfDocument.pages. Apply the result with PdfDocument.setPage or PdfDocument.setPages.
The resulting PdfPage.
Creates a page-placement proxy rotated 90 degrees clockwise relative to this page.
Calling this method does not change PdfDocument.pages. Apply the result with PdfDocument.setPage or PdfDocument.setPages.
The resulting PdfPage.
Creates a page-placement proxy with the requested absolute rotation.
Calling this method alone does not modify the PDF or PdfDocument.pages. Pass the returned page to PdfDocument.setPage to replace one placement, or include it in the array passed to PdfDocument.setPages. Those methods update the in-memory arrangement synchronously; PdfDocument.encodePdf or PdfDocument.materialize later writes the arrangement into the physical PDF.
rotation is clockwise and absolute: 90 means the page is displayed at
90 degrees regardless of the page's current rotation property. If it
already has the requested rotation, this method returns this.
The clockwise page rotation, in 90-degree steps.
The resulting PdfPage.
Internal
Stages the complete Link list used by ordinary annotation CRUD.
Internal
Reserved for internal use only. This page as a source slot for PdfDocument.materialize.
Internal
Reserved for internal use only. Converts a bounding-box-relative page point
(as used by PdfFormField.rects / loadLinks) back to raw PDF
page coordinates, which the form-fill FORM_On* input APIs expect.
Internal
Replaces annotation id with a fresh annotation built from the complete
spec, preserving the id. PDFium has no in-place geometry setter.
The PdfAnnotationObject.id returned by
loadAnnotations, or the id returned by addAnnotation.
This is normally the annotation dictionary's /NM ("annotation name")
value: a PDF-standard string used to distinguish annotations on the
page. Existing PDFs whose annotation has no /NM use a page-local
@<index> fallback; use
that fallback only with the unchanged result from the most recent
loadAnnotations() call because page mutations can change the index.
The spec value (PdfAnnotationSpec).
Optionaloptions: PdfAnnotationMutationOptions
Options that customize the operation.
The resulting Promise.
Internal
Writes staged Link annotations to the physical page represented by this page.
A page of a document. Obtain instances via PdfDocument.pages; do not construct directly.
A page has two identities that usually coincide but need not: where it sits in the document (pageNumber, its
rotation) and which physical page of which PDF it draws (sourcePage). rotatedTo returns a proxy page that changes the effective rotation while sharing the physical page. PdfDocument.setPages similarly assigns placement and page numbers from array order, which is what makes rearrangement free.