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

Public Member Functions

void AddBoolean (bool boolean_value)
 Add a boolean value to the end of current PDF array object. More...
 
void AddDateTime (const DateTime &date_time)
 Add a date time to the end of current PDF array object. More...
 
void AddElement (PDFObject *element)
 Add a PDF object to the end of current PDF array object. More...
 
void AddFloat (float float_value)
 Add a float value to the end of current PDF array object. More...
 
void AddInteger (int integer_value)
 Add an integer value to the end of current PDF array object. More...
 
void AddMatrix (const Matrix &matrix)
 Add a matrix to the end of current PDF array object. More...
 
void AddName (const char *name)
 Add a string as PDF name object to the end of current PDF array object. More...
 
void AddRect (const RectF &rect)
 Add a rectangle to the end of current PDF array object. More...
 
void AddString (const wchar_t *new_string)
 Add a string as PDF string object to the end of current PDF array object. More...
 
PDFObjectGetElement (int index) const
 Get a specified element by index. More...
 
int GetElementCount () const
 Get the count of elements. More...
 
void InsertAt (int index, PDFObject *element)
 Insert a PDF object to a specified position in current PDF array object. More...
 
void RemoveAt (int index)
 Remove an element in a specified position (by index) from current PDF array object. More...
 
void SetAt (int index, PDFObject *element)
 Set a new PDF object at a specified position in current PDF array object. More...
 
- Public Member Functions inherited from foxit::pdf::objects::PDFObject
PDFObjectCloneObject () const
 Clone current PDF object and get the cloned PDF object. More...
 
PDFObjectDeepCloneObject () const
 Clone current PDF object and get the cloned PDF object. More...
 
PDFArrayGetArray ()
 Get the PDF array object of current PDF object. More...
 
bool GetBoolean () const
 Get the boolean value of current PDF object. More...
 
DateTime GetDateTime () const
 Get the date time value of current PDF object. More...
 
PDFDictionaryGetDict ()
 Get the PDF dictionary object of current PDF object. More...
 
PDFObjectGetDirectObject () const
 Get the direct object of current PDF object. More...
 
float GetFloat () const
 Get the float value of current PDF object. More...
 
int GetInteger () const
 Get the integer value of current PDF object. More...
 
Matrix GetMatrix () const
 Get the matrix value of current PDF object. More...
 
String GetName () const
 Get the name value of current PDF object. More...
 
uint32 GetObjNum () const
 Get the indirect object number of current PDF object. More...
 
RectF GetRect () const
 Get the rectangle value of current PDF object. More...
 
PDFStreamGetStream ()
 Get the PDF stream object of current PDF object. More...
 
String GetString () const
 Get the string value of current PDF object. More...
 
Type GetType () const
 Get the type of current PDF object. More...
 
WString GetWideString () const
 Get the wide string value of current PDF object. More...
 
bool IsIdentical (PDFObject *pdf_obj) const
 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 PDFArrayCreate ()
 Create a new array object. More...
 
static PDFArrayCreateFromMatrix (const Matrix &matrix)
 Create a new array object for a matrix. More...
 
static PDFArrayCreateFromRect (const RectF &rect)
 Create a new array object for a rectangle. More...
 
- Static Public Member Functions inherited from foxit::pdf::objects::PDFObject
static PDFObjectCreateFromBoolean (bool boolean_value)
 Create a PDF object from a boolean value. More...
 
static PDFObjectCreateFromDateTime (const DateTime &date_time)
 Create a PDF object from date time. More...
 
static PDFObjectCreateFromFloat (float float_value)
 Create a PDF object from a float number. More...
 
static PDFObjectCreateFromInteger (int integer_value)
 Create a PDF object from a integer number. More...
 
static PDFObjectCreateFromName (const char *name)
 Create a PDF object from a string which represents a name. More...
 
static PDFObjectCreateFromString (const wchar_t *string_value)
 Create a PDF object from string. More...
 
static PDFObjectCreateReference (PDFDoc document, uint32 object_number)
 Create a reference for an indirect object. More...
 

Additional Inherited Members

- Public Types inherited from foxit::pdf::objects::PDFObject
enum  Type {
  e_InvalidType = 0, e_Boolean = 1, e_Number = 2, e_String = 3,
  e_Name = 4, e_Array = 5, e_Dictionary = 6, e_Stream = 7,
  e_Null = 8, e_Reference = 9
}
 Enumeration for PDF object type. More...
 

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 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 foxit::pdf::objects::PDFArray::AddBoolean ( bool  boolean_value)

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 foxit::pdf::objects::PDFArray::AddDateTime ( const DateTime date_time)

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 foxit::pdf::objects::PDFArray::AddElement ( PDFObject element)

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 foxit::pdf::objects::PDFArray::AddFloat ( float  float_value)

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 foxit::pdf::objects::PDFArray::AddInteger ( int  integer_value)

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 foxit::pdf::objects::PDFArray::AddMatrix ( const Matrix matrix)

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

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

◆ AddName()

void foxit::pdf::objects::PDFArray::AddName ( const char *  name)

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 foxit::pdf::objects::PDFArray::AddRect ( const RectF rect)

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

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

◆ AddString()

void foxit::pdf::objects::PDFArray::AddString ( const wchar_t *  new_string)

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* foxit::pdf::objects::PDFArray::Create ( )
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. If there is any error, this function will return NULL.

◆ CreateFromMatrix()

static PDFArray* foxit::pdf::objects::PDFArray::CreateFromMatrix ( const Matrix matrix)
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. If there is any error, this function will return NULL.

◆ CreateFromRect()

static PDFArray* foxit::pdf::objects::PDFArray::CreateFromRect ( const RectF rect)
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. If there is any error, this function will return NULL.

◆ GetElement()

PDFObject* foxit::pdf::objects::PDFArray::GetElement ( int  index) const

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. If there is any error, this function will return NULL.

◆ GetElementCount()

int foxit::pdf::objects::PDFArray::GetElementCount ( ) const

Get the count of elements.

Returns
Element count.

◆ InsertAt()

void foxit::pdf::objects::PDFArray::InsertAt ( int  index,
PDFObject element 
)

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 foxit::pdf::objects::PDFArray::RemoveAt ( int  index)

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 foxit::pdf::objects::PDFArray::SetAt ( int  index,
PDFObject element 
)

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.