Class: PDFPageProxy

pdfjsLib~PDFPageProxy()

Proxy to a `PDFPage` in the worker thread.

Constructor

new PDFPageProxy()

Source:

Members

pageNumber :number

Page number of the page. First page is 1.
Type:
  • number
Source:

ref :Object

The reference that points to this page. It has `num` and `gen` properties.
Type:
  • Object
Source:

rotate :number

The number of degrees the page is rotated clockwise.
Type:
  • number
Source:

stats :Object

Returns page stats, if enabled; returns `null` otherwise.
Type:
  • Object
Source:

userUnit :number

The default size of units in 1/72nds of an inch.
Type:
  • number
Source:

view :Array.<number>

An array of the visible portion of the PDF page in user space units [x1, y1, x2, y2].
Type:
  • Array.<number>
Source:

Methods

cleanup(resetStatsopt) → {boolean}

Cleans up resources allocated by the page.
Parameters:
Name Type Attributes Default Description
resetStats boolean <optional>
false Reset page stats, if enabled. The default value is `false`.
Source:
Returns:
Indicates if clean-up was successfully run.
Type
boolean

getAnnotations(params) → {Promise.<Array.<any>>}

Parameters:
Name Type Description
params GetAnnotationsParameters Annotation parameters.
Source:
Returns:
A promise that is resolved with an {Array} of the annotation objects.
Type
Promise.<Array.<any>>

getJSActions() → {Promise.<Object>}

Source:
Returns:
A promise that is resolved with an {Object} with JS actions.
Type
Promise.<Object>

getOperatorList() → {Promise.<PDFOperatorList>}

Source:
Returns:
A promise resolved with an PDFOperatorList object that represents page's operator list.
Type
Promise.<PDFOperatorList>

getStructTree() → {Promise.<StructTreeNode>}

Source:
Returns:
A promise that is resolved with a StructTreeNode object that represents the page's structure tree, or `null` when no structure tree is present for the current page.
Type
Promise.<StructTreeNode>

getTextContent(params) → {Promise.<TextContent>}

Parameters:
Name Type Description
params getTextContentParameters getTextContent parameters.
Source:
Returns:
A promise that is resolved with a TextContent object that represents the page's text content.
Type
Promise.<TextContent>

getViewport(params) → {PageViewport}

Parameters:
Name Type Description
params GetViewportParameters Viewport parameters.
Source:
Returns:
Contains 'width' and 'height' properties along with transforms required for rendering.
Type
PageViewport

getXfa() → {Promise.<(Object|null)>}

Source:
Returns:
A promise that is resolved with an {Object} with a fake DOM object (a tree structure where elements are {Object} with a name, attributes (class, style, ...), value and children, very similar to a HTML DOM tree), or `null` if no XFA exists.
Type
Promise.<(Object|null)>

render(params) → {RenderTask}

Begins the process of rendering a page to the desired context.
Parameters:
Name Type Description
params RenderParameters Page render parameters.
Source:
Returns:
An object that contains a promise that is resolved when the page finishes rendering.
Type
RenderTask

streamTextContent(params) → {ReadableStream}

Parameters:
Name Type Description
params getTextContentParameters getTextContent parameters.
Source:
Returns:
Stream for reading text content chunks.
Type
ReadableStream