Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Obj

desc

This class represents a PDF indirect Object in memory It is possible to manipulate the stream which can be appended to the object(if the object is of underlying type dictionary) A PdfObject is uniquely identified by an object number and generation number The object can easily be written to a file using the write function

todo

New instance object not yet supported. Objects can only be instantiated from an existing object

Hierarchy

  • Obj

Implements

Index

Constructors

constructor

  • new Obj(instance: any): Obj

Properties

Private _instance

_instance: any

Accessors

length

  • get length(): any

reference

  • get reference(): any

stream

  • get stream(): any

type

  • get type(): any

Methods

asArray

  • The asArray method returns an Array Proxy (or an Object that is wrapped in a proxy that exposes methods similar to an array, which modifies the underlying PdfArray Object). This is NOT an array, but provides a data structure as close to an array as possible to help user's view/modify the data. If a method or property is not supported a console message will be provided.

    Returns NArray

asBool

  • asBool(): boolean

asBuffer

  • asBuffer(): Buffer

asName

  • asName(): string

asNumber

  • asNumber(): number

asObject

  • asObject(): object

asReal

  • asReal(): number

asReference

  • asReference(): Ref

asString

  • asString(): string

delayedStreamLoad

  • delayedStreamLoad(): void

flateCompressStream

  • flateCompressStream(): void
  • desc

    This function compresses any currently set stream using the FlateDecode algorithm. JPEG compressed streams will not be compressed again using this function. Entries to the filter dictionary will be added if necessary.

    Returns void

getOffset

  • getOffset(key: string): Promise<number>
  • desc

    Calculates the byte offset of key from the start of the object if the object was written to disk at the moment of calling the function This function is very calculation intensive!

    Parameters

    • key: string

      object dictionary key

    Returns Promise<number>

    • byte offset

hasStream

  • hasStream(): boolean

write

  • write(output: string, cb: Function): void

Generated using TypeDoc