PDFArray Class Documentation

class PDFArray : PDFObject

Namespace:com::datalogics::PDFL

Inherits from:
PDFObject

Detailed Description

Represents an array of data elements within a PDF document. All objects in a PDF document are built from a collection of simpler objects that represent fundamental datatypes like numbers, strings and arrays. PDFObject and its subclasses allow direct access and manipulation of these simple objects. Some subclasses represent single data elements. For example, PDFInteger represents a single integer value. Others represent a collection of PDFObjects, like PDFArray, an indexed array of data elements.

A PDFArray is a heterogenous collection object that gathers other PDFObjects (including other PDFArrays) into an indexed list.

Constructor & Destructor Documentation

PDFArray

PDFArray(Document doc, boolean indirect)

Parameters

doc: Document

Document object containing this PDFArray

indirect: boolean

flag marking this as an indirect PDFObject

General constructor

PDFArray

PDFArray(PDFObject docFromObj, boolean indirect)

Parameters

docFromObj: PDFObject

The new PDFArray will be created in the same document as this object.

indirect: boolean

flag marking this as an indirect PDFObject

General constructor

Member Function Documentation

add

void add(PDFObject object)

Parameters

object: PDFObject

Returns:

void

Adds an object to the end of the array

clone

PDFObject clone()

Returns:

PDFObject

A new PDFObject that is a copy of this object.

Makes a new copy of this PDFObject in memory, in the same document and using same direct/indirect setting as this PDFObject.

clone

PDFObject clone(Document doc)

Parameters

doc: Document

The target document in which to create the copy.

Returns:

PDFObject

A new PDFObject that is a copy of this object in the specified document.

Makes a new copy of this PDFObject in memory, in the supplied document, using the same direct/indirect setting as this PDFObject.

clone

PDFObject clone(Document doc, boolean indirect)

Parameters

doc: Document

The target document in which to create the copy.

indirect: boolean

If true, the copy will be an indirect object; if false, it will be direct.

Returns:

PDFObject

A new PDFObject that is a copy of this object in the specified document.

Makes a new copy of this PDFObject in memory, in the supplied document, using supplied direct/indirect setting.

clone

PDFObject clone(PDFObject obj)

Parameters

obj: PDFObject

The reference object whose document will be used for the copy.

Returns:

PDFObject

A new PDFObject that is a copy of this object in the same document as obj.

Makes a new copy of this PDFObject in memory, in the same document as another object, using the same direct/indirect setting as this PDFObject.

clone

PDFObject clone(PDFObject obj, boolean indirect)

Parameters

obj: PDFObject

The reference object whose document will be used for the copy.

indirect: boolean

If true, the copy will be an indirect object; if false, it will be direct.

Returns:

PDFObject

A new PDFObject that is a copy of this object in the same document as obj.

Makes a new copy of this PDFObject in memory, in the same document as another object, using supplied direct/indirect setting.

compareTo

PDFObjectComparison compareTo(PDFObject rhs)

Parameters

rhs: PDFObject

the other PDFObject to compare.

Returns:

PDFObjectComparison

A PDFObjectComparison value that relates this object to the rhs object

Compares this object to another object. The result is useful for ordering or sorting PDFObjects. No other significance should be attached to the result. In particular, an unequal result indicates nothing about the type of either object.

The result is valid only within a single instance of the document.

delete

synchronized void delete(Boolean disposing)

Parameters

disposing: Boolean

Returns:

synchronized void

delete

synchronized void delete()

Returns:

synchronized void

destroy

void destroy()

Returns:

void

Destroys this object.

This method does nothing if this object is a direct scalar object.

If a composite object (an array, dictionary or stream) is destroyed:
All the direct objects in it are automatically destroyed.

The indirect objects in it are not destroyed.

enumPDFObjects

boolean enumPDFObjects(PDFObjectEnumProc enumProc)

Parameters

enumProc: PDFObjectEnumProc

A user-supplied callback to call for each element of the object. of obj. Neither proc nor any routine called by proc may modify the object. Doing so can produce undefined results or errors. For example, if the object is an array, enumProc must not call Remove(); if the object is a dictionary, enumProc must not call Put().

Returns:

boolean

Returns true if every call to enumProc returned true. As soon as any call to enumProc returns false, the enumeration stops and EnumPDFObject() returns false.

Enumerates the elements of a PDFObject by calling a user-supplied procedure for each component of the object.
For scalars or strings, the proc is not called, and CosObjEnum() returns true.

For dictionaries, proc is called for each key-value pair. The order in which the key-value pairs are enumerated is undefined.

For arrays, proc is called with each element as the first paramater to proc, and the NULL object as the second parameter. Array elements are enumerated in ascending order of index.

For streams, proc is called once, with the stream's dictionary as the first parameter to the proc and the NULL object as the second parameter.

equals

boolean equals(Object rhs)

Parameters

rhs: Object

Returns:

boolean

finalize

void finalize()

Returns:

void

get

PDFObject get(int index)

Parameters

index: int

Returns:

PDFObject

Returns the object at the given index.

getDocument

Document getDocument()

Returns:

Document

the Document in which the object resides.

The Document of which this object is a member. Returns null if the Document is not known by PDFL, or if it is a temporary document.

If the Document is not null, then it shares the same internal data with other Document objects that refer to the same file. Document objects returned this way do not contribute to the internal count that keeps the Document open, and will become invalid if the main reference to the document is disposed.

getGeneration

int getGeneration()

Returns:

int

The generation number of this indirect object.

The generation number for this object. Only indirect objects have a generation number.

getID

int getID()

Returns:

int

The ID number of this indirect object.

The ID number for this object. Only indirect objects have an ID number.

getIndirect

boolean getIndirect()

Returns:

boolean

true if this object is indirect, false if it is direct.

Indicates if this object is indirect or direct.

getLength

int getLength()

Returns:

int

The number of elements in this array.

getPDFHashValue

int getPDFHashValue()

Returns:

int

The 32-bit hash value for this object.

The 32-bit hash value for this object. The hash value is used internally to quickly access the object, and is not generally useful for PDFObject users. Note that two PDFObjects with equal hash values are not necessarily equal; use Equals() to check for equality.

insert

void insert(int index, PDFObject object)

Parameters

index: int
object: PDFObject

Returns:

void

Inserts an object at the given index, displacing existing objects. All objects following this will have their index increased by one.

put

void put(int index, PDFObject obj)

Parameters

index: int

Returns:

void

Puts an object at the given index, replacing the existing item. The index can be greater than the current length of the array; the array will be extended and the empty slots filled with null objects.

remove

void remove(PDFObject object)

Parameters

object: PDFObject

Returns:

void

Removes the first object that matches the given object. The length of the array is reduced by 1.

removeAt

void removeAt(int index)

Parameters

index: int

Returns:

void

Removes the object at the given index. The length of the array is reduced by 1.

toString

String toString()

Returns:

String

A string describing this PDFObject.

Returns a string representation of this PDFObject. The string includes the object's indirect status, and if indirect, its ID and generation number.