Class: PDFObjects

pdfjsLib~PDFObjects()

A PDF document and page is built of many objects. E.g. there are objects for fonts, images, rendering code, etc. These objects may get processed inside of a worker. This class implements some basic methods to manage these objects.

Constructor

new PDFObjects()

Source:

Methods

(objId) → {Object}

Ensures there is an object defined for `objId`.
Parameters:
Name Type Description
objId string
Source:
Returns:
Type
Object

get(objId, callbackopt) → {any}

If called *without* callback, this returns the data of `objId` but the object needs to be resolved. If it isn't, this method throws. If called *with* a callback, the callback is called with the data of the object once the object is resolved. That means, if you call this method and the object is already resolved, the callback gets called right away.
Parameters:
Name Type Attributes Default Description
objId string
callback function <optional>
null
Source:
Returns:
Type
any

has(objId) → {boolean}

Parameters:
Name Type Description
objId string
Source:
Returns:
Type
boolean

resolve(objId, dataopt)

Resolves the object `objId` with optional `data`.
Parameters:
Name Type Attributes Default Description
objId string
data any <optional>
null
Source: