class Object {
readonly reference: Ref
readonly length: number
readonly stream: Stream
readonly type: NPDFDataType
immutable: boolean
constructor()
constructor(s: string)
constructor(a: string[] | number[])
constructor(d: number)
hasStream(): boolean
getOffset(key: string, cb: Callback<number>): void
write(output: string, cb: Function): void
flateCompressStream(): void
delayedStreamLoad(): void
getBool(): boolean
getDictionary(): Dictionary
getString(): string
getName(): string
getReal(): number
getNumber(): number
getArray(): Array
getRawData(): Buffer
clear(): void
resolveIndirectKey(key: string): nopodofo.Object
}
constructor()
The default constructor, calling NoPoDoFo.Object() will create a new instance of a PoDoFo::PdfObject as type Dictionary
constructor(s: string)
Creates a new instance of NoPoDoFo::Object as type string.
constructor(a: string[] | number[])
Create a new instance of NoPoDoFo::Object with type of array. Currently only supports single dimension, homogeneous arrays.
constructor(n: number)
Create a new instance of NoPoDoFo::Object as type number.
Get the reference of the object. If the object is not an indirect object a reference is not available. This would signify that the object is an inline object.
Get the byte length of the object
If the object has a stream, get the stream as a Nodejs Buffer
Get the type of object as one of NPDFDataType
Get or set immutability
hasStream(): boolean
Check if the Object has a stream
getOffset(key: string, cb: Callback<number>): void
Get the byte offset of the object. This method is expensive as it has to calculate the offset of the object if the object was written to disk.
write(output: string, cb: Function): void
Write the object to disk, useful for debugging
flateCompressStream(): void
Compress the object stream using the FlateDecode algorithm. Entries to the filter Dictionary will be added if necessary.
delayedStreamLoad(): void
Dynamically load the object and any associated stream if the stream is not already loaded
getBool(): boolean
Get the object as a boolean value
getDictionary(): Dictionary
Get the object as a PDF Dictionary value. This is a copy or readonly instance of the dictionary (this is currently a limitation of the lower level api). Any changes made to this dictionary will not be persisted back to the document. Higher level api's are available for manipulating dictionary values (ex. Form [DA, DR, CO, and SigFlags]). If there is a use case that you need that is not yet exposed please submit an issue.
getString(): string
Get the object as a string value
getName(): string
Get the object as a name (string) value
getReal(): number
Get the object as a real (number) value
getNumber(): number
Get the object as a number value
getArray(): Array
Get the object as an Array value
getBuffer(): Buffer
Get the object as a Buffer value, data is copied into a nodejs buffer.
clear(): void
Clear the object from memory and all internal variables.
resolveIndirectKey(key: string): nopodofo.Object
Resolve a Dictionary key. The object type must be a Dictionary. If the key could not be resolved an error will be thrown.