Foxit PDF SDK

Instance Methods | Class Methods | List of all members
FSPDFArray Class Reference
Inheritance diagram for FSPDFArray:

## Instance Methods
(void) | - addBoolean:
| Add a boolean value to the end of current PDF array object. More...
(void) | - addDateTime:
| Add a date time to the end of current PDF array object. More...
(void) | - addElement:
| Add a PDF object to the end of current PDF array object. More...
(void) | - addFloat:
| Add a float value to the end of current PDF array object. More...
(void) | - addInteger:
| Add an integer value to the end of current PDF array object. More...
(void) | - addMatrix:
| Add a matrix to the end of current PDF array object. More...
(void) | - addName:
| Add a string as PDF name object to the end of current PDF array object. More...
(void) | - addRect:
| Add a rectangle to the end of current PDF array object. More...
(void) | - addReference:document:
| Set the reference object of an indirect PDF object (whose object number is always above 0) as value element. More...
(void) | - addString:
| Add a string as PDF string object to the end of current PDF array object. More...
(FSPDFObject *) | - getElement:
| Get a specified element by index. More...
(int) | - getElementCount
| Get the count of elements. More...
(void) | - insertAt:element:
| Insert a PDF object to a specified position in current PDF array object. More...
(void) | - removeAt:
| Remove an element in a specified position (by index) from current PDF array object. More...
(void) | - setAt:element:
| Set a new PDF object at a specified position in current PDF array object. More...
Instance Methods inherited from FSPDFObject
(FSPDFObject *) | - cloneObject
| Clone current PDF object and get the cloned PDF object. More...
(FSPDFObject *) | - deepCloneObject
| Clone current PDF object and get the cloned PDF object. More...
(void) | - destroy
| 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...
(FSPDFArray *) | - getArray
| Get the PDF array object of current PDF object. More...
(BOOL) | - getBoolean
| Get the boolean value of current PDF object. More...
(FSDateTime *) | - getDateTime
| Get the date time value of current PDF object. More...
(FSPDFDictionary *) | - getDict
| Get the PDF dictionary object of current PDF object. More...
(FSPDFObject *) | - getDirectObject
| Get the direct object of current PDF object. More...
(float) | - getFloat
| Get the float value of current PDF object. More...
(int) | - getInteger
| Get the integer value of current PDF object. More...
(FSMatrix2D *) | - getMatrix
| Get the matrix value of current PDF object. More...
(NSString *) | - getName
| Get the name value of current PDF object. More...
(unsigned int) | - getObjNum
| Get the indirect object number of current PDF object. More...
(FSRectF *) | - getRect
| Get the rectangle value of current PDF object. More...
(FSPDFStream *) | - getStream
| Get the PDF stream object of current PDF object. More...
(NSData *) | - getString
| Get the string value of current PDF object. More...
(FSPDFObjectType) | - getType
| Get the type of current PDF object. More...
(NSString *) | - getWideString
| Get the wide string value of current PDF object. More...
(BOOL) | - isIdentical:
| Check if input PDF object is identical with current PDF object. More...

## Class Methods
(FSPDFArray *) | + create
| Create a new array object. More...
(FSPDFArray *) | + createFromMatrix:
| Create a new array object for a matrix. More...
(FSPDFArray *) | + createFromRect:
| Create a new array object for a rectangle. More...
Class Methods inherited from FSPDFObject
(FSPDFObject *) | + createFromBoolean:
| Create a PDF object from a boolean value. More...
(FSPDFObject *) | + createFromDateTime:
| Create a PDF object from date time. More...
(FSPDFObject *) | + createFromFloat:
| Create a PDF object from a float number. More...
(FSPDFObject *) | + createFromInteger:
| Create a PDF object from a integer number. More...
(FSPDFObject *) | + createFromName:
| Create a PDF object from a string which represents a name. More...
(FSPDFObject *) | + createFromNameW:
| Create a PDF object from a string which represents a name. More...
(FSPDFObject *) | + createFromString:
| Create a PDF object from string. More...
(FSPDFObject *) | + createFromStringWithLength:length:
| Create a PDF object from string. More...
(FSPDFObject *) | + createReference:object_number:
| Create a reference for an indirect object. 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 FSPDFArray is derived from FSPDFObject and offers functions to create a new PDF array object and get/set elements of a PDF array object.

See also
  FSPDFObject

## Method Documentation

## ◆ addBoolean:()

- (void) addBoolean: |  | (BOOL) | boolean_value |

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

Parameters

  [in] | boolean_value | A boolean value to current PDF array object.

Returns
  None.

## ◆ addDateTime:()

- (void) addDateTime: |  | (FSDateTime*) | date_time |

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

Parameters

  [in] | date_time | A date time to current PDF array object.

Returns
  None.

## ◆ addElement:()

- (void) addElement: |  | (FSPDFObject*) | element |

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

Parameters

  [in] | element | A PDF object to be added to current PDF array object. It should not be nil.

Returns
  None.

## ◆ addFloat:()

- (void) addFloat: |  | (float) | float_value |

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

Parameters

  [in] | float_value | A float value to current PDF array object.

Returns
  None.

## ◆ addInteger:()

- (void) addInteger: |  | (int) | integer_value |

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

Parameters

  [in] | integer_value | An integer value to current PDF array object.

Returns
  None.

## ◆ addMatrix:()

- (void) addMatrix: |  | (FSMatrix2D*) | matrix |

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

Parameters

  [in] | matrix | A matrix to current PDF array object.

Returns
  None.

## ◆ addName:()

- (void) addName: |  | (NSString *) | name |

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

Parameters

  [in] | name | A string to be added as PDF name object to current PDF array object. It should not be an empty string.

Returns
  None.

## ◆ addRect:()

- (void) addRect: |  | (FSRectF*) | rect |

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

Parameters

  [in] | rect | A rectangle to current PDF array object.

Returns
  None.

## ◆ addReference:document:()

- (void) addReference: |  | (FSPDFObject*) | pdf_object
document: |  | (FSPDFDoc*) | document

Set the reference object of an indirect PDF object (whose object number is always above 0) as value element.

If user wants to set direct PDF object (whose object number is always equal to 0) to an entry, please refer to function FSPDFDictionary::setAt:pdf_object:.

Parameters

  [in] | pdf_object | A FSPDFObject object which is an indirect PDF object (whose object number is always above 0) and will be set to the entry by a reference object which refers to this indirect object. It should not be nil.
  [in] | document | A valid PDF document object, to which current PDF dictionary object belongs and in which parameter pdf_object is or will be an indirect object.

Returns
  None.

## ◆ addString:()

- (void) addString: |  | (NSString *) | new_string |

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

Parameters

  [in] | new_string | A string to be added as PDF string object to current PDF array object. It should not be an empty string.

Returns
  None.

## ◆ create()

+ (FSPDFArray *) create |  |  |

Create a new array object.

Please call function FSPDFObject::destroy 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.

Returns
  A new FSPDFArray object. If there is any error, this function will return nil.

## ◆ createFromMatrix:()

+ (FSPDFArray *) createFromMatrix: |  | (FSMatrix2D*) | matrix |

Create a new array object for a matrix.

Please call function FSPDFObject::destroy 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.

Parameters

  [in] | matrix | A matrix.

Returns
  A new FSPDFArray object. If there is any error, this function will return nil.

## ◆ createFromRect:()

+ (FSPDFArray *) createFromRect: |  | (FSRectF*) | rect |

Create a new array object for a rectangle.

Please call function FSPDFObject::destroy 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.

Parameters

  [in] | rect | A rectangle.

Returns
  A new FSPDFArray object. If there is any error, this function will return nil.

## ◆ getElement:()

- (FSPDFObject *) getElement: |  | (int) | index |

Get a specified element by index.

Parameters

  [in] | index | Index of the element to be retrieved. Valid range: from 0 to (count-1). count is returned by function FSPDFArray::getElementCount.

Returns
  A FSPDFObject object that receives the specified element. If there is any error, this function will return nil.

## ◆ getElementCount()

- (int) getElementCount |  |  |

Get the count of elements.

Returns
  Element count.

## ◆ insertAt:element:()

- (void) insertAt: |  | (int) | index
element: |  | (FSPDFObject*) | element

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

Parameters

  [in] | index | Index of the position where parameter element will be inserted to. Valid range: from 0 to (count-1). count is returned by function FSPDFArray::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] | element | A PDF object to be inserted to current PDF array object. It should not be nil.

Returns
  None.

## ◆ removeAt:()

- (void) removeAt: |  | (int) | index |

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

Parameters

  [in] | index | Index of the position where the element will be removed. Valid range: from 0 to (count-1). count is returned by function FSPDFArray::getElementCount.

Returns
  None.

## ◆ setAt:element:()

- (void) setAt: |  | (int) | index
element: |  | (FSPDFObject*) | element

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

Parameters

  [in] | index | Index of the position where parameter element will be set to. Valid range: from 0 to (count-1). count is returned by function FSPDFArray::getElementCount.
  [in] | element | A PDF object to be set to current PDF array object. It should not be nil.

Returns
  None.