happypdf / PDFPageTree
Class: PDFPageTree
Defined in: src/core/structures/PDFPageTree.ts:12
Extends
Constructors
Constructor
protected new PDFPageTree(map, context): PDFPageTree;Defined in: src/core/objects/PDFDict.ts:28
Parameters
| Parameter | Type |
|---|---|
map | DictMap |
context | PDFContext |
Returns
PDFPageTree
Inherited from
Properties
context
readonly context: PDFContext;Defined in: src/core/objects/PDFDict.ts:22
Inherited from
suppressEncryption
suppressEncryption: boolean = false;Defined in: src/core/objects/PDFDict.ts:26
Inherited from
Methods
ascend()
ascend(visitor): void;Defined in: src/core/structures/PDFPageTree.ts:152
Parameters
| Parameter | Type |
|---|---|
visitor | (node) => any |
Returns
void
asMap()
asMap(): Map<PDFName, PDFObject>;Defined in: src/core/objects/PDFDict.ts:162
Returns
Inherited from
clone()
clone(context?): PDFDict;Defined in: src/core/objects/PDFDict.ts:176
Parameters
| Parameter | Type |
|---|---|
context? | PDFContext |
Returns
Inherited from
copyBytesInto()
copyBytesInto(buffer, offset): number;Defined in: src/core/objects/PDFDict.ts:207
Parameters
| Parameter | Type |
|---|---|
buffer | Uint8Array |
offset | number |
Returns
number
Inherited from
Count()
Count(): PDFNumber;Defined in: src/core/structures/PDFPageTree.ts:33
Returns
delete()
delete(key): boolean;Defined in: src/core/objects/PDFDict.ts:157
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
Returns
boolean
Inherited from
entries()
entries(): [PDFName, PDFObject][];Defined in: src/core/objects/PDFDict.ts:42
Returns
Inherited from
fromMapWithContext()
static fromMapWithContext(map, context): PDFPageTree;Defined in: src/core/structures/PDFPageTree.ts:22
Parameters
| Parameter | Type |
|---|---|
map | DictMap |
context | PDFContext |
Returns
PDFPageTree
Overrides
get()
get(key, preservePDFNull?): PDFObject | undefined;Defined in: src/core/objects/PDFDict.ts:51
Parameters
| Parameter | Type | Default value |
|---|---|---|
key | PDFName | undefined |
preservePDFNull | boolean | false |
Returns
PDFObject | undefined
Inherited from
has()
has(key): boolean;Defined in: src/core/objects/PDFDict.ts:62
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
Returns
boolean
Inherited from
insertLeafNode()
insertLeafNode(leafRef, targetIndex): PDFRef | undefined;Defined in: src/core/structures/PDFPageTree.ts:56
Inserts the given ref as a leaf node of this page tree at the specified index (zero-based). Also increments the Count of each page tree in the hierarchy to accomodate the new page.
Returns the ref of the PDFPageTree node into which leafRef was inserted, or undefined if it was inserted into the root node (the PDFPageTree upon which the method was first called).
Parameters
| Parameter | Type |
|---|---|
leafRef | PDFRef |
targetIndex | number |
Returns
PDFRef | undefined
keys()
keys(): PDFName[];Defined in: src/core/objects/PDFDict.ts:34
Returns
PDFName[]
Inherited from
Kids()
Kids(): PDFArray;Defined in: src/core/structures/PDFPageTree.ts:29
Returns
lookup()
Call Signature
lookup(key): PDFObject | undefined;Defined in: src/core/objects/PDFDict.ts:113
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
Returns
PDFObject | undefined
Inherited from
Call Signature
lookup(key, type): PDFArray;Defined in: src/core/objects/PDFDict.ts:114
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFArray |
Returns
Inherited from
Call Signature
lookup(key, type): PDFBool;Defined in: src/core/objects/PDFDict.ts:115
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFBool |
Returns
Inherited from
Call Signature
lookup(key, type): PDFDict;Defined in: src/core/objects/PDFDict.ts:116
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFDict |
Returns
Inherited from
Call Signature
lookup(key, type): PDFHexString;Defined in: src/core/objects/PDFDict.ts:117
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFHexString |
Returns
Inherited from
Call Signature
lookup(key, type): PDFName;Defined in: src/core/objects/PDFDict.ts:118
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFName |
Returns
Inherited from
Call Signature
lookup(key, type): PDFNull;Defined in: src/core/objects/PDFDict.ts:119
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | PDFNull |
Returns
PDFNull
Inherited from
Call Signature
lookup(key, type): PDFNumber;Defined in: src/core/objects/PDFDict.ts:120
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFNumber |
Returns
Inherited from
Call Signature
lookup(key, type): PDFStream;Defined in: src/core/objects/PDFDict.ts:121
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFStream |
Returns
Inherited from
Call Signature
lookup(key, type): PDFRef;Defined in: src/core/objects/PDFDict.ts:122
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFRef |
Returns
Inherited from
Call Signature
lookup(key, type): PDFString;Defined in: src/core/objects/PDFDict.ts:123
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFString |
Returns
Inherited from
Call Signature
lookup(
ref,
type1,
type2): PDFHexString | PDFString;Defined in: src/core/objects/PDFDict.ts:124
Parameters
| Parameter | Type |
|---|---|
ref | PDFName |
type1 | typeof PDFString |
type2 | typeof PDFHexString |
Returns
Inherited from
Call Signature
lookup(
ref,
type1,
type2): PDFStream | PDFDict;Defined in: src/core/objects/PDFDict.ts:129
Parameters
| Parameter | Type |
|---|---|
ref | PDFName |
type1 | typeof PDFDict |
type2 | typeof PDFStream |
Returns
Inherited from
Call Signature
lookup(
ref,
type1,
type2,
type3):
| PDFHexString
| PDFString
| PDFArray;Defined in: src/core/objects/PDFDict.ts:134
Parameters
| Parameter | Type |
|---|---|
ref | PDFName |
type1 | typeof PDFString |
type2 | typeof PDFHexString |
type3 | typeof PDFArray |
Returns
| PDFHexString | PDFString | PDFArray
Inherited from
lookupMaybe()
Call Signature
lookupMaybe(key, type): PDFArray | undefined;Defined in: src/core/objects/PDFDict.ts:67
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFArray |
Returns
PDFArray | undefined
Inherited from
Call Signature
lookupMaybe(key, type): PDFBool | undefined;Defined in: src/core/objects/PDFDict.ts:68
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFBool |
Returns
PDFBool | undefined
Inherited from
Call Signature
lookupMaybe(key, type): PDFDict | undefined;Defined in: src/core/objects/PDFDict.ts:69
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFDict |
Returns
PDFDict | undefined
Inherited from
Call Signature
lookupMaybe(key, type): PDFHexString | undefined;Defined in: src/core/objects/PDFDict.ts:70
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFHexString |
Returns
PDFHexString | undefined
Inherited from
Call Signature
lookupMaybe(key, type): PDFName | undefined;Defined in: src/core/objects/PDFDict.ts:74
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFName |
Returns
PDFName | undefined
Inherited from
Call Signature
lookupMaybe(key, type): PDFNull | undefined;Defined in: src/core/objects/PDFDict.ts:75
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | PDFNull |
Returns
PDFNull | undefined
Inherited from
Call Signature
lookupMaybe(key, type): PDFNumber | undefined;Defined in: src/core/objects/PDFDict.ts:76
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFNumber |
Returns
PDFNumber | undefined
Inherited from
Call Signature
lookupMaybe(key, type): PDFStream | undefined;Defined in: src/core/objects/PDFDict.ts:77
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFStream |
Returns
PDFStream | undefined
Inherited from
Call Signature
lookupMaybe(key, type): PDFRef | undefined;Defined in: src/core/objects/PDFDict.ts:78
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFRef |
Returns
PDFRef | undefined
Inherited from
Call Signature
lookupMaybe(key, type): PDFString | undefined;Defined in: src/core/objects/PDFDict.ts:79
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
type | typeof PDFString |
Returns
PDFString | undefined
Inherited from
Call Signature
lookupMaybe(
ref,
type1,
type2):
| PDFHexString
| PDFString
| undefined;Defined in: src/core/objects/PDFDict.ts:80
Parameters
| Parameter | Type |
|---|---|
ref | PDFName |
type1 | typeof PDFString |
type2 | typeof PDFHexString |
Returns
| PDFHexString | PDFString | undefined
Inherited from
Call Signature
lookupMaybe(
ref,
type1,
type2): PDFStream | PDFDict | undefined;Defined in: src/core/objects/PDFDict.ts:85
Parameters
| Parameter | Type |
|---|---|
ref | PDFName |
type1 | typeof PDFDict |
type2 | typeof PDFStream |
Returns
PDFStream | PDFDict | undefined
Inherited from
Call Signature
lookupMaybe(
ref,
type1,
type2,
type3):
| PDFHexString
| PDFString
| PDFArray
| undefined;Defined in: src/core/objects/PDFDict.ts:90
Parameters
| Parameter | Type |
|---|---|
ref | PDFName |
type1 | typeof PDFString |
type2 | typeof PDFHexString |
type3 | typeof PDFArray |
Returns
| PDFHexString | PDFString | PDFArray | undefined
Inherited from
Parent()
Parent(): PDFPageTree | undefined;Defined in: src/core/structures/PDFPageTree.ts:25
Returns
PDFPageTree | undefined
pushLeafNode()
pushLeafNode(leafRef): void;Defined in: src/core/structures/PDFPageTree.ts:42
Parameters
| Parameter | Type |
|---|---|
leafRef | PDFRef |
Returns
void
pushTreeNode()
pushTreeNode(treeRef): void;Defined in: src/core/structures/PDFPageTree.ts:37
Parameters
| Parameter | Type |
|---|---|
treeRef | PDFRef |
Returns
void
registerChange()
registerChange(): void;Defined in: src/core/objects/PDFDict.ts:229
Returns
void
Inherited from
removeLeafNode()
removeLeafNode(targetIndex, prune?): void;Defined in: src/core/structures/PDFPageTree.ts:111
Removes the leaf node at the specified index (zero-based) from this page tree. Also decrements the Count of each page tree in the hierarchy to account for the removed page.
If prune is true, then intermediate tree nodes will be removed from the tree if they contain 0 children after the leaf node is removed.
Parameters
| Parameter | Type | Default value |
|---|---|---|
targetIndex | number | undefined |
prune | boolean | true |
Returns
void
set()
set(key, value): void;Defined in: src/core/objects/PDFDict.ts:46
Parameters
| Parameter | Type |
|---|---|
key | PDFName |
value | PDFObject |
Returns
void
Inherited from
sizeInBytes()
sizeInBytes(): number;Defined in: src/core/objects/PDFDict.ts:197
Returns
number
Inherited from
toString()
toString(): string;Defined in: src/core/objects/PDFDict.ts:186
Returns
string
Inherited from
traverse()
traverse(visitor): void;Defined in: src/core/structures/PDFPageTree.ts:159
Performs a Post-Order traversal of this page tree
Parameters
| Parameter | Type |
|---|---|
visitor | (node, ref) => any |
Returns
void
uniqueKey()
uniqueKey(tag?): PDFName;Defined in: src/core/objects/PDFDict.ts:167
Generate a random key that doesn't exist in current key set
Parameters
| Parameter | Type | Default value |
|---|---|---|
tag | string | '' |
Returns
Inherited from
values()
values(): PDFObject[];Defined in: src/core/objects/PDFDict.ts:38
Returns
Inherited from
withContext()
static withContext(context, parent?): PDFPageTree;Defined in: src/core/structures/PDFPageTree.ts:13
Parameters
| Parameter | Type |
|---|---|
context | PDFContext |
parent? | PDFRef |
Returns
PDFPageTree