Skip to content

happypdf / PDFCatalog

Class: PDFCatalog ​

Defined in: src/core/structures/PDFCatalog.ts:11

Extends ​

Constructors ​

Constructor ​

ts
protected new PDFCatalog(map, context): PDFCatalog;

Defined in: src/core/objects/PDFDict.ts:28

Parameters ​

ParameterType
mapDictMap
contextPDFContext

Returns ​

PDFCatalog

Inherited from ​

PDFDict.constructor

Properties ​

context ​

ts
readonly context: PDFContext;

Defined in: src/core/objects/PDFDict.ts:22

Inherited from ​

PDFDict.context


suppressEncryption ​

ts
suppressEncryption: boolean = false;

Defined in: src/core/objects/PDFDict.ts:26

Inherited from ​

PDFDict.suppressEncryption

Methods ​

AcroForm() ​

ts
AcroForm(): PDFDict | undefined;

Defined in: src/core/structures/PDFCatalog.ts:29

Returns ​

PDFDict | undefined


asMap() ​

ts
asMap(): Map<PDFName, PDFObject>;

Defined in: src/core/objects/PDFDict.ts:162

Returns ​

Map&lt;PDFName, PDFObject&gt;

Inherited from ​

PDFDict.asMap


AttachedFiles() ​

ts
AttachedFiles(): PDFArray | undefined;

Defined in: src/core/structures/PDFCatalog.ts:37

Returns ​

PDFArray | undefined


clone() ​

ts
clone(context?): PDFDict;

Defined in: src/core/objects/PDFDict.ts:176

Parameters ​

ParameterType
context?PDFContext

Returns ​

PDFDict

Inherited from ​

PDFDict.clone


copyBytesInto() ​

ts
copyBytesInto(buffer, offset): number;

Defined in: src/core/objects/PDFDict.ts:207

Parameters ​

ParameterType
bufferUint8Array
offsetnumber

Returns ​

number

Inherited from ​

PDFDict.copyBytesInto


delete() ​

ts
delete(key): boolean;

Defined in: src/core/objects/PDFDict.ts:157

Parameters ​

ParameterType
keyPDFName

Returns ​

boolean

Inherited from ​

PDFDict.delete


entries() ​

ts
entries(): [PDFName, PDFObject][];

Defined in: src/core/objects/PDFDict.ts:42

Returns ​

[PDFName, PDFObject][]

Inherited from ​

PDFDict.entries


fromMapWithContext() ​

ts
static fromMapWithContext(map, context): PDFCatalog;

Defined in: src/core/structures/PDFCatalog.ts:22

Parameters ​

ParameterType
mapDictMap
contextPDFContext

Returns ​

PDFCatalog

Overrides ​

PDFDict.fromMapWithContext


get() ​

ts
get(key, preservePDFNull?): PDFObject | undefined;

Defined in: src/core/objects/PDFDict.ts:51

Parameters ​

ParameterTypeDefault value
keyPDFNameundefined
preservePDFNullbooleanfalse

Returns ​

PDFObject | undefined

Inherited from ​

PDFDict.get


getAcroForm() ​

ts
getAcroForm(): PDFAcroForm | undefined;

Defined in: src/core/structures/PDFCatalog.ts:41

Returns ​

PDFAcroForm | undefined


getOCProperties() ​

ts
getOCProperties(): OptionalContentProperties | undefined;

Defined in: src/core/structures/PDFCatalog.ts:77

Returns ​

OptionalContentProperties | undefined


getOrCreateAcroForm() ​

ts
getOrCreateAcroForm(): PDFAcroForm;

Defined in: src/core/structures/PDFCatalog.ts:47

Returns ​

PDFAcroForm


getOrCreateViewerPreferences() ​

ts
getOrCreateViewerPreferences(): ViewerPreferences;

Defined in: src/core/structures/PDFCatalog.ts:67

Returns ​

ViewerPreferences


getViewerPreferences() ​

ts
getViewerPreferences(): ViewerPreferences | undefined;

Defined in: src/core/structures/PDFCatalog.ts:61

Returns ​

ViewerPreferences | undefined


has() ​

ts
has(key): boolean;

Defined in: src/core/objects/PDFDict.ts:62

Parameters ​

ParameterType
keyPDFName

Returns ​

boolean

Inherited from ​

PDFDict.has


insertLeafNode() ​

ts
insertLeafNode(leafRef, index): PDFRef;

Defined in: src/core/structures/PDFCatalog.ts:89

Inserts the given ref as a leaf node of this catalog's page tree at the specified index (zero-based). Also increments the Count of each node in the page tree hierarchy to accomodate the new page.

Returns the ref of the PDFPageTree node into which leafRef was inserted.

Parameters ​

ParameterType
leafRefPDFRef
indexnumber

Returns ​

PDFRef


keys() ​

ts
keys(): PDFName[];

Defined in: src/core/objects/PDFDict.ts:34

Returns ​

PDFName[]

Inherited from ​

PDFDict.keys


lookup() ​

Call Signature ​

ts
lookup(key): PDFObject | undefined;

Defined in: src/core/objects/PDFDict.ts:113

Parameters ​
ParameterType
keyPDFName
Returns ​

PDFObject | undefined

Inherited from ​

PDFDict.lookup

Call Signature ​

ts
lookup(key, type): PDFArray;

Defined in: src/core/objects/PDFDict.ts:114

Parameters ​
ParameterType
keyPDFName
typetypeof PDFArray
Returns ​

PDFArray

Inherited from ​

PDFDict.lookup

Call Signature ​

ts
lookup(key, type): PDFBool;

Defined in: src/core/objects/PDFDict.ts:115

Parameters ​
ParameterType
keyPDFName
typetypeof PDFBool
Returns ​

PDFBool

Inherited from ​

PDFDict.lookup

Call Signature ​

ts
lookup(key, type): PDFDict;

Defined in: src/core/objects/PDFDict.ts:116

Parameters ​
ParameterType
keyPDFName
typetypeof PDFDict
Returns ​

PDFDict

Inherited from ​

PDFDict.lookup

Call Signature ​

ts
lookup(key, type): PDFHexString;

Defined in: src/core/objects/PDFDict.ts:117

Parameters ​
ParameterType
keyPDFName
typetypeof PDFHexString
Returns ​

PDFHexString

Inherited from ​

PDFDict.lookup

Call Signature ​

ts
lookup(key, type): PDFName;

Defined in: src/core/objects/PDFDict.ts:118

Parameters ​
ParameterType
keyPDFName
typetypeof PDFName
Returns ​

PDFName

Inherited from ​

PDFDict.lookup

Call Signature ​

ts
lookup(key, type): PDFNull;

Defined in: src/core/objects/PDFDict.ts:119

Parameters ​
ParameterType
keyPDFName
typePDFNull
Returns ​

PDFNull

Inherited from ​

PDFDict.lookup

Call Signature ​

ts
lookup(key, type): PDFNumber;

Defined in: src/core/objects/PDFDict.ts:120

Parameters ​
ParameterType
keyPDFName
typetypeof PDFNumber
Returns ​

PDFNumber

Inherited from ​

PDFDict.lookup

Call Signature ​

ts
lookup(key, type): PDFStream;

Defined in: src/core/objects/PDFDict.ts:121

Parameters ​
ParameterType
keyPDFName
typetypeof PDFStream
Returns ​

PDFStream

Inherited from ​

PDFDict.lookup

Call Signature ​

ts
lookup(key, type): PDFRef;

Defined in: src/core/objects/PDFDict.ts:122

Parameters ​
ParameterType
keyPDFName
typetypeof PDFRef
Returns ​

PDFRef

Inherited from ​

PDFDict.lookup

Call Signature ​

ts
lookup(key, type): PDFString;

Defined in: src/core/objects/PDFDict.ts:123

Parameters ​
ParameterType
keyPDFName
typetypeof PDFString
Returns ​

PDFString

Inherited from ​

PDFDict.lookup

Call Signature ​

ts
lookup(
   ref, 
   type1, 
   type2): PDFHexString | PDFString;

Defined in: src/core/objects/PDFDict.ts:124

Parameters ​
ParameterType
refPDFName
type1typeof PDFString
type2typeof PDFHexString
Returns ​

PDFHexString | PDFString

Inherited from ​

PDFDict.lookup

Call Signature ​

ts
lookup(
   ref, 
   type1, 
   type2): PDFStream | PDFDict;

Defined in: src/core/objects/PDFDict.ts:129

Parameters ​
ParameterType
refPDFName
type1typeof PDFDict
type2typeof PDFStream
Returns ​

PDFStream | PDFDict

Inherited from ​

PDFDict.lookup

Call Signature ​

ts
lookup(
   ref, 
   type1, 
   type2, 
   type3): 
  | PDFHexString
  | PDFString
  | PDFArray;

Defined in: src/core/objects/PDFDict.ts:134

Parameters ​
ParameterType
refPDFName
type1typeof PDFString
type2typeof PDFHexString
type3typeof PDFArray
Returns ​

| PDFHexString | PDFString | PDFArray

Inherited from ​

PDFDict.lookup


lookupMaybe() ​

Call Signature ​

ts
lookupMaybe(key, type): PDFArray | undefined;

Defined in: src/core/objects/PDFDict.ts:67

Parameters ​
ParameterType
keyPDFName
typetypeof PDFArray
Returns ​

PDFArray | undefined

Inherited from ​

PDFDict.lookupMaybe

Call Signature ​

ts
lookupMaybe(key, type): PDFBool | undefined;

Defined in: src/core/objects/PDFDict.ts:68

Parameters ​
ParameterType
keyPDFName
typetypeof PDFBool
Returns ​

PDFBool | undefined

Inherited from ​

PDFDict.lookupMaybe

Call Signature ​

ts
lookupMaybe(key, type): PDFDict | undefined;

Defined in: src/core/objects/PDFDict.ts:69

Parameters ​
ParameterType
keyPDFName
typetypeof PDFDict
Returns ​

PDFDict | undefined

Inherited from ​

PDFDict.lookupMaybe

Call Signature ​

ts
lookupMaybe(key, type): PDFHexString | undefined;

Defined in: src/core/objects/PDFDict.ts:70

Parameters ​
ParameterType
keyPDFName
typetypeof PDFHexString
Returns ​

PDFHexString | undefined

Inherited from ​

PDFDict.lookupMaybe

Call Signature ​

ts
lookupMaybe(key, type): PDFName | undefined;

Defined in: src/core/objects/PDFDict.ts:74

Parameters ​
ParameterType
keyPDFName
typetypeof PDFName
Returns ​

PDFName | undefined

Inherited from ​

PDFDict.lookupMaybe

Call Signature ​

ts
lookupMaybe(key, type): PDFNull | undefined;

Defined in: src/core/objects/PDFDict.ts:75

Parameters ​
ParameterType
keyPDFName
typePDFNull
Returns ​

PDFNull | undefined

Inherited from ​

PDFDict.lookupMaybe

Call Signature ​

ts
lookupMaybe(key, type): PDFNumber | undefined;

Defined in: src/core/objects/PDFDict.ts:76

Parameters ​
ParameterType
keyPDFName
typetypeof PDFNumber
Returns ​

PDFNumber | undefined

Inherited from ​

PDFDict.lookupMaybe

Call Signature ​

ts
lookupMaybe(key, type): PDFStream | undefined;

Defined in: src/core/objects/PDFDict.ts:77

Parameters ​
ParameterType
keyPDFName
typetypeof PDFStream
Returns ​

PDFStream | undefined

Inherited from ​

PDFDict.lookupMaybe

Call Signature ​

ts
lookupMaybe(key, type): PDFRef | undefined;

Defined in: src/core/objects/PDFDict.ts:78

Parameters ​
ParameterType
keyPDFName
typetypeof PDFRef
Returns ​

PDFRef | undefined

Inherited from ​

PDFDict.lookupMaybe

Call Signature ​

ts
lookupMaybe(key, type): PDFString | undefined;

Defined in: src/core/objects/PDFDict.ts:79

Parameters ​
ParameterType
keyPDFName
typetypeof PDFString
Returns ​

PDFString | undefined

Inherited from ​

PDFDict.lookupMaybe

Call Signature ​

ts
lookupMaybe(
   ref, 
   type1, 
   type2): 
  | PDFHexString
  | PDFString
  | undefined;

Defined in: src/core/objects/PDFDict.ts:80

Parameters ​
ParameterType
refPDFName
type1typeof PDFString
type2typeof PDFHexString
Returns ​

| PDFHexString | PDFString | undefined

Inherited from ​

PDFDict.lookupMaybe

Call Signature ​

ts
lookupMaybe(
   ref, 
   type1, 
   type2): PDFStream | PDFDict | undefined;

Defined in: src/core/objects/PDFDict.ts:85

Parameters ​
ParameterType
refPDFName
type1typeof PDFDict
type2typeof PDFStream
Returns ​

PDFStream | PDFDict | undefined

Inherited from ​

PDFDict.lookupMaybe

Call Signature ​

ts
lookupMaybe(
   ref, 
   type1, 
   type2, 
   type3): 
  | PDFHexString
  | PDFString
  | PDFArray
  | undefined;

Defined in: src/core/objects/PDFDict.ts:90

Parameters ​
ParameterType
refPDFName
type1typeof PDFString
type2typeof PDFHexString
type3typeof PDFArray
Returns ​

| PDFHexString | PDFString | PDFArray | undefined

Inherited from ​

PDFDict.lookupMaybe


Names() ​

ts
Names(): PDFDict | undefined;

Defined in: src/core/structures/PDFCatalog.ts:33

Returns ​

PDFDict | undefined


Pages() ​

ts
Pages(): PDFPageTree;

Defined in: src/core/structures/PDFCatalog.ts:25

Returns ​

PDFPageTree


registerChange() ​

ts
registerChange(): void;

Defined in: src/core/objects/PDFDict.ts:229

Returns ​

void

Inherited from ​

PDFDict.registerChange


removeLeafNode() ​

ts
removeLeafNode(index): void;

Defined in: src/core/structures/PDFCatalog.ts:95

Parameters ​

ParameterType
indexnumber

Returns ​

void


set() ​

ts
set(key, value): void;

Defined in: src/core/objects/PDFDict.ts:46

Parameters ​

ParameterType
keyPDFName
valuePDFObject

Returns ​

void

Inherited from ​

PDFDict.set


sizeInBytes() ​

ts
sizeInBytes(): number;

Defined in: src/core/objects/PDFDict.ts:197

Returns ​

number

Inherited from ​

PDFDict.sizeInBytes


toString() ​

ts
toString(): string;

Defined in: src/core/objects/PDFDict.ts:186

Returns ​

string

Inherited from ​

PDFDict.toString


uniqueKey() ​

ts
uniqueKey(tag?): PDFName;

Defined in: src/core/objects/PDFDict.ts:167

Generate a random key that doesn't exist in current key set

Parameters ​

ParameterTypeDefault value
tagstring''

Returns ​

PDFName

Inherited from ​

PDFDict.uniqueKey


values() ​

ts
values(): PDFObject[];

Defined in: src/core/objects/PDFDict.ts:38

Returns ​

PDFObject[]

Inherited from ​

PDFDict.values


ViewerPreferences() ​

ts
ViewerPreferences(): PDFDict | undefined;

Defined in: src/core/structures/PDFCatalog.ts:57

Returns ​

PDFDict | undefined


withContext() ​

ts
static withContext(context): PDFDict;

Defined in: src/core/objects/PDFDict.ts:17

Parameters ​

ParameterType
contextPDFContext

Returns ​

PDFDict

Inherited from ​

PDFDict.withContext


withContextAndPages() ​

ts
static withContextAndPages(context, pages): PDFCatalog;

Defined in: src/core/structures/PDFCatalog.ts:12

Parameters ​

ParameterType
contextPDFContext
pagesPDFRef | PDFPageTree

Returns ​

PDFCatalog

MIT Licensed. A fork of pdf-lib.