Classes
- PDFDataRangeTransport
- PDFDocumentLoadingTask
- PDFDocumentProxy
- PDFObjects
- PDFPageProxy
- PDFWorker
- RenderTask
Members
(inner, constant) build :string
Type:
- string
(inner, constant) version :string
Type:
- string
Methods
(inner) getDocument(src) → {PDFDocumentLoadingTask}
This is the main entry point for loading a PDF and interacting with it.
NOTE: If a URL is used to fetch the PDF data a standard Fetch API call (or
XHR as fallback) is used, which means it must follow same origin rules,
e.g. no cross-domain requests without CORS.
Parameters:
Name | Type | Description |
---|---|---|
src |
string | URL | TypedArray | ArrayBuffer | DocumentInitParameters | Can be a URL where a PDF file is located, a typed array (Uint8Array) already populated with data, or a parameter object. |
Returns:
- Type
- PDFDocumentLoadingTask
Type Definitions
DocumentInitParameters
Document initialization / loading parameters object.
Type:
- Object
Properties:
GetAnnotationsParameters
Page annotation parameters.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
intent |
string |
<optional> |
Determines the annotations that are fetched, can be 'display' (viewable annotations), 'print' (printable annotations), or 'any' (all annotations). The default value is 'display'. |
GetOperatorListParameters
Page getOperatorList parameters.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
intent |
string |
<optional> |
Rendering intent, can be 'display', 'print', or 'any'. The default value is 'display'. |
annotationMode |
number |
<optional> |
Controls which annotations are included in the operatorList, for annotations with appearance-data; the values from AnnotationMode should be used. The following values are supported: - `AnnotationMode.DISABLE`, which disables all annotations. - `AnnotationMode.ENABLE`, which includes all possible annotations (thus it also depends on the `intent`-option, see above). - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain interactive form elements (those will be rendered in the display layer). - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations (as above) but where interactive form elements are updated with data from the AnnotationStorage-instance; useful e.g. for printing. The default value is `AnnotationMode.ENABLE`. |
printAnnotationStorage |
PrintAnnotationStorage |
<optional> |
|
isEditing |
boolean |
<optional> |
Render the page in editing mode. |
GetOptionalContentConfigParameters
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
intent |
string |
<optional> |
Determines the optional content groups that are visible by default; valid values are: - 'display' (viewable groups). - 'print' (printable groups). - 'any' (all groups). The default value is 'display'. |
GetViewportParameters
Page getViewport parameters.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
scale |
number | The desired scale of the viewport. | |
rotation |
number |
<optional> |
The desired rotation, in degrees, of the viewport. If omitted it defaults to the page rotation. |
offsetX |
number |
<optional> |
The horizontal, i.e. x-axis, offset. The default value is `0`. |
offsetY |
number |
<optional> |
The vertical, i.e. y-axis, offset. The default value is `0`. |
dontFlip |
boolean |
<optional> |
If true, the y-axis will not be flipped. The default value is `false`. |
MarkInfo
Properties correspond to Table 321 of the PDF 32000-1:2008 spec.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
Marked |
boolean | |
UserProperties |
boolean | |
Suspects |
boolean |
OnProgressParameters
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
loaded |
number | Currently loaded number of bytes. |
total |
number | Total number of bytes in the PDF file. |
OutlineNode
Type:
- Object
Properties:
PDFOperatorList
PDF page operator list.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
fnArray |
Array:.<number:> | Array containing the operator functions. |
argsArray |
Array:.<any:> | Array containing the arguments of the functions. |
PDFWorkerParameters
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
The name of the worker. |
port |
Worker |
<optional> |
The `workerPort` object. |
verbosity |
number |
<optional> |
Controls the logging level; the constants from VerbosityLevel should be used. |
RefProxy
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
num |
number | |
gen |
number |
RenderParameters
Page render parameters.
Type:
- Object
Properties:
StructTreeContent
Structure tree content.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
type |
string | either "content" for page and stream structure elements or "object" for object references. |
id |
string | unique id that will map to the text layer. |
StructTreeNode
Structure tree node. The root node will have a role "Root".
Type:
- Object
Properties:
TextContent
Page text content.
Type:
- Object
Properties:
TextItem
Page text content part.
Type:
- Object
Properties:
TextMarkedContent
Page text marked content part.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
type |
string | Either 'beginMarkedContent', 'beginMarkedContentProps', or 'endMarkedContent'. |
id |
string | The marked content identifier. Only used for type 'beginMarkedContentProps'. |
TextStyle
Text style.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
ascent |
number | Font ascent. |
descent |
number | Font descent. |
vertical |
boolean | Whether or not the text is in vertical mode. |
fontFamily |
string | The possible font family. |
TypedArray
Type:
- Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array
getTextContentParameters
Page getTextContent parameters.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
includeMarkedContent |
boolean |
<optional> |
When true include marked content items in the items array of TextContent. The default is `false`. |
disableNormalization |
boolean |
<optional> |
When true the text is *not* normalized in the worker-thread. The default is `false`. |