Foxit PDF SDK
com.foxit.sdk.pdf.objects.PDFArray Class Reference
Inheritance diagram for com.foxit.sdk.pdf.objects.PDFArray:
com.foxit.sdk.pdf.objects.PDFObject

Public Member Functions

void addBoolean (boolean boolean_value) throws com.foxit.sdk.PDFException
 Add a boolean value to the end of current PDF array object. More...
 
void addDateTime (DateTime date_time) throws com.foxit.sdk.PDFException
 Add a date time to the end of current PDF array object. More...
 
void addElement (PDFObject element) throws com.foxit.sdk.PDFException
 Add a PDF object to the end of current PDF array object. More...
 
void addFloat (float float_value) throws com.foxit.sdk.PDFException
 Add a float value to the end of current PDF array object. More...
 
void addInteger (int integer_value) throws com.foxit.sdk.PDFException
 Add an integer value to the end of current PDF array object. More...
 
void addMatrix (Matrix2D matrix) throws com.foxit.sdk.PDFException
 Add a matrix to the end of current PDF array object. More...
 
void addName (String name) throws com.foxit.sdk.PDFException
 Add a string as PDF name object to the end of current PDF array object. More...
 
void addRect (RectF rect) throws com.foxit.sdk.PDFException
 Add a rectangle to the end of current PDF array object. More...
 
void addString (String new_string) throws com.foxit.sdk.PDFException
 Add a string as PDF string object to the end of current PDF array object. More...
 
synchronized void delete ()
 Clean up related resources immediately. More...
 
PDFObject getElement (int index) throws com.foxit.sdk.PDFException
 Get a specified element by index. More...
 
int getElementCount () throws com.foxit.sdk.PDFException
 Get the count of elements. More...
 
void insertAt (int index, PDFObject element) throws com.foxit.sdk.PDFException
 Insert a PDF object to a specified position in current PDF array object. More...
 
void removeAt (int index) throws com.foxit.sdk.PDFException
 Remove an element in a specified position (by index) from current PDF array object. More...
 
void setAt (int index, PDFObject element) throws com.foxit.sdk.PDFException
 Set a new PDF object at a specified position in current PDF array object. More...
 
- Public Member Functions inherited from com.foxit.sdk.pdf.objects.PDFObject
PDFObject cloneObject ()
 Clone current PDF object and get the cloned PDF object. More...
 
PDFObject deepCloneObject ()
 Clone current PDF object and get the cloned PDF object. More...
 
synchronized void delete ()
 Clean up related resources immediately. More...
 
PDFArray getArray ()
 Get the PDF array object of current PDF object. More...
 
boolean getBoolean () throws com.foxit.sdk.PDFException
 Get the boolean value of current PDF object. More...
 
DateTime getDateTime () throws com.foxit.sdk.PDFException
 Get the date time value of current PDF object. More...
 
PDFDictionary getDict ()
 Get the PDF dictionary object of current PDF object. More...
 
PDFObject getDirectObject ()
 Get the direct object of current PDF object. More...
 
float getFloat () throws com.foxit.sdk.PDFException
 Get the float value of current PDF object. More...
 
int getInteger () throws com.foxit.sdk.PDFException
 Get the integer value of current PDF object. More...
 
Matrix2D getMatrix () throws com.foxit.sdk.PDFException
 Get the matrix value of current PDF object. More...
 
String getName () throws com.foxit.sdk.PDFException
 Get the name value of current PDF object. More...
 
int getObjNum ()
 Get the indirect object number of current PDF object. More...
 
RectF getRect () throws com.foxit.sdk.PDFException
 Get the rectangle value of current PDF object. More...
 
PDFStream getStream ()
 Get the PDF stream object of current PDF object. More...
 
byte [] getString ()
 Get the string value of current PDF object. More...
 
int getType ()
 Get the type of current PDF object. More...
 
String getWideString ()
 Get the wide string value of current PDF object. More...
 
boolean isIdentical (PDFObject pdf_obj)
 Check if input PDF object is identical with current PDF object. More...
 
void release ()
 Release a newly created PDF object or a clone PDF object, which is not related to PDF document or other PDF object and will not be used any more. More...
 

Static Public Member Functions

static PDFArray create () throws com.foxit.sdk.PDFException
 Create a new array object. More...
 
static PDFArray createFromMatrix (Matrix2D matrix) throws com.foxit.sdk.PDFException
 Create a new array object for a matrix. More...
 
static PDFArray createFromRect (RectF rect) throws com.foxit.sdk.PDFException
 Create a new array object for a rectangle. More...
 
- Static Public Member Functions inherited from com.foxit.sdk.pdf.objects.PDFObject
static PDFObject createFromBoolean (boolean boolean_value)
 Create a PDF object from a boolean value. More...
 
static PDFObject createFromDateTime (DateTime date_time)
 Create a PDF object from date time. More...
 
static PDFObject createFromFloat (float float_value)
 Create a PDF object from a float number. More...
 
static PDFObject createFromInteger (int integer_value)
 Create a PDF object from a integer number. More...
 
static PDFObject createFromName (String name)
 Create a PDF object from a string which represents a name. More...
 
static PDFObject createFromString (String string_value)
 Create a PDF object from string. More...
 
static PDFObject createReference (PDFDoc document, int object_number)
 Create a reference for an indirect object. More...
 

Additional Inherited Members

- Static Public Attributes inherited from com.foxit.sdk.pdf.objects.PDFObject
static final int e_Array = 5
 PDF array object.
 
static final int e_Boolean = 1
 PDF boolean object.
 
static final int e_Dictionary = 6
 PDF dictionary object.
 
static final int e_InvalidType = 0
 Invalid PDF object type.
 
static final int e_Name = 4
 PDF name object.
 
static final int e_Null = 8
 PDF null object.
 
static final int e_Number = 2
 PDF number object.
 
static final int e_Reference = 9
 PDF reference object.
 
static final int e_Stream = 7
 PDF stream object.
 
static final int e_String = 3
 PDF string object.
 

Detailed Description

A PDF array object is a one-dimensional collection of objects arranged sequentially. Unlike arrays in many other computer languages, elements in a PDF array can be any combination of numbers, strings, dictionaries, or any other objects, including other arrays. For more details, please refer to Section 3.2.5 "Array Objects" in <PDF Reference 1.7>.
Class com.foxit.sdk.pdf.objects.PDFArray is derived from PDFObject and offers functions to create a new PDF array object and get/set elements of a PDF array object.

See also
PDFObject

Member Function Documentation

◆ addBoolean()

void com.foxit.sdk.pdf.objects.PDFArray.addBoolean ( boolean  boolean_value) throws com.foxit.sdk.PDFException

Add a boolean value to the end of current PDF array object.

Parameters
[in]boolean_valueA boolean value to current PDF array object.
Returns
None.

◆ addDateTime()

void com.foxit.sdk.pdf.objects.PDFArray.addDateTime ( DateTime  date_time) throws com.foxit.sdk.PDFException

Add a date time to the end of current PDF array object.

Parameters
[in]date_timeA date time to current PDF array object.
Returns
None.

◆ addElement()

void com.foxit.sdk.pdf.objects.PDFArray.addElement ( PDFObject  element) throws com.foxit.sdk.PDFException

Add a PDF object to the end of current PDF array object.

Parameters
[in]elementA PDF object to be added to current PDF array object. It should not be null.
Returns
None.

◆ addFloat()

void com.foxit.sdk.pdf.objects.PDFArray.addFloat ( float  float_value) throws com.foxit.sdk.PDFException

Add a float value to the end of current PDF array object.

Parameters
[in]float_valueA float value to current PDF array object.
Returns
None.

◆ addInteger()

void com.foxit.sdk.pdf.objects.PDFArray.addInteger ( int  integer_value) throws com.foxit.sdk.PDFException

Add an integer value to the end of current PDF array object.

Parameters
[in]integer_valueAn integer value to current PDF array object.
Returns
None.

◆ addMatrix()

void com.foxit.sdk.pdf.objects.PDFArray.addMatrix ( Matrix2D  matrix) throws com.foxit.sdk.PDFException

Add a matrix to the end of current PDF array object.

Parameters
[in]matrixA matrix to current PDF array object.
Returns
None.

◆ addName()

void com.foxit.sdk.pdf.objects.PDFArray.addName ( String  name) throws com.foxit.sdk.PDFException

Add a string as PDF name object to the end of current PDF array object.

Parameters
[in]nameA string to be added as PDF name object to current PDF array object. It should not be an empty string.
Returns
None.

◆ addRect()

void com.foxit.sdk.pdf.objects.PDFArray.addRect ( RectF  rect) throws com.foxit.sdk.PDFException

Add a rectangle to the end of current PDF array object.

Parameters
[in]rectA rectangle to current PDF array object.
Returns
None.

◆ addString()

void com.foxit.sdk.pdf.objects.PDFArray.addString ( String  new_string) throws com.foxit.sdk.PDFException

Add a string as PDF string object to the end of current PDF array object.

Parameters
[in]new_stringA string to be added as PDF string object to current PDF array object. It should not be an empty string.
Returns
None.

◆ create()

static PDFArray com.foxit.sdk.pdf.objects.PDFArray.create ( ) throws com.foxit.sdk.PDFException
static

Create a new array object.

Returns
A new PDFArray object. Please call function PDFObject.release to release the created object if it has not been added/set into PDF document or other PDF object and will not be used any more.

◆ createFromMatrix()

static PDFArray com.foxit.sdk.pdf.objects.PDFArray.createFromMatrix ( Matrix2D  matrix) throws com.foxit.sdk.PDFException
static

Create a new array object for a matrix.

Parameters
[in]matrixA matrix.
Returns
A new PDFArray object. Please call function PDFObject.release to release the created object if it has not been added/set into PDF document or other PDF object and will not be used any more.

◆ createFromRect()

static PDFArray com.foxit.sdk.pdf.objects.PDFArray.createFromRect ( RectF  rect) throws com.foxit.sdk.PDFException
static

Create a new array object for a rectangle.

Parameters
[in]rectA rectangle.
Returns
A new PDFArray object. Please call function PDFObject.release to release the created object if it has not been added/set into PDF document or other PDF object and will not be used any more.

◆ delete()

synchronized void com.foxit.sdk.pdf.objects.PDFArray.delete ( )

Clean up related resources immediately.

Returns
None.
Note
Once this function is called, current object cannot be used anymore.

◆ getElement()

PDFObject com.foxit.sdk.pdf.objects.PDFArray.getElement ( int  index) throws com.foxit.sdk.PDFException

Get a specified element by index.

Parameters
[in]indexIndex of the element to be retrieved. Valid range: from 0 to (count-1). count is returned by function PDFArray.getElementCount .
Returns
A PDFObject object that receives the specified element.

◆ getElementCount()

int com.foxit.sdk.pdf.objects.PDFArray.getElementCount ( ) throws com.foxit.sdk.PDFException

Get the count of elements.

Returns
Element count

◆ insertAt()

void com.foxit.sdk.pdf.objects.PDFArray.insertAt ( int  index,
PDFObject  element 
) throws com.foxit.sdk.PDFException

Insert a PDF object to a specified position in current PDF array object.

Parameters
[in]indexIndex of the position where parameter element will be inserted to. Valid range: from 0 to (count-1). count is returned by function PDFArray.getElementCount .
If this is below 0 or count of elements in current PDF array is 0, parameter element is to be inserted to the first position.
If this is larger than count of element in current PDF array, parameter element is to be added to the end.
[in]elementA PDF object to be inserted to current PDF array object. It should not be null.
Returns
None.

◆ removeAt()

void com.foxit.sdk.pdf.objects.PDFArray.removeAt ( int  index) throws com.foxit.sdk.PDFException

Remove an element in a specified position (by index) from current PDF array object.

Parameters
[in]indexIndex of the position where the element will be removed. Valid range: from 0 to (count-1). count is returned by function PDFArray.getElementCount .
Returns
None.

◆ setAt()

void com.foxit.sdk.pdf.objects.PDFArray.setAt ( int  index,
PDFObject  element 
) throws com.foxit.sdk.PDFException

Set a new PDF object at a specified position in current PDF array object.

Parameters
[in]indexIndex of the position where parameter element will be set to. Valid range: from 0 to (count-1). count is returned by function PDFArray.getElementCount .
[in]elementA PDF object to be set to current PDF array object. It should not be null.
Returns
None.