Foxit PDF SDK

Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
FSDK.PDFObject Class Reference
Inheritance diagram for FSDK.PDFObject:

## Public Member Functions
| CloneObject ()
| Clone current PDF object and get the cloned PDF object. More...
| DeepCloneObject ()
| Clone current PDF object and get the cloned PDF object. More...
| GetArray ()
| Get the PDF array object of current PDF object. More...
| GetBoolean ()
| Get the boolean value of current PDF object. More...
| GetDateTime ()
| Get the date time value of current PDF object. More...
| GetDict ()
| Get the PDF dictionary object of current PDF object. More...
| GetDirectObject ()
| Get the direct object of current PDF object. More...
| GetFloat ()
| Get the float value of current PDF object. More...
| GetInteger ()
| Get the integer value of current PDF object. More...
| GetMatrix ()
| Get the matrix value of current PDF object. More...
| GetName ()
| Get the name value of current PDF object. More...
| GetObjNum ()
| Get the indirect object number of current PDF object. More...
| GetRect ()
| Get the rectangle value of current PDF object. More...
| GetStream ()
| Get the PDF stream object of current PDF object. More...
| GetString ()
| Get the string value of current PDF object. More...
| GetType ()
| Get the type of current PDF object. More...
| GetWideString ()
| Get the wide string value of current PDF object. More...
| IsIdentical (pdf_obj)
| Check if input PDF object is identical with current PDF object. More...
| 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 | CreateFromBoolean (boolean_value)
| Create a PDF object from a boolean value. More...
static | CreateFromDateTime (date_time)
| Create a PDF object from date time. More...
static | CreateFromFloat (float_value)
| Create a PDF object from a float number. More...
static | CreateFromInteger (integer_value)
| Create a PDF object from a integer number. More...
static | CreateFromName (name)
| Create a PDF object from a string which represents a name. More...
static | CreateFromNameW (name)
| Create a PDF object from a string which represents a name. More...
static | CreateFromString (string_value)
| Create a PDF object from string. More...
static | CreateFromString (string_value, length)
| Create a PDF object from string. More...
static | CreateReference (document, object_number)
| Create a reference for an indirect object. More...

## Static Public Attributes
static | e_Array
| PDF array object.
static | e_Boolean
| PDF boolean object.
static | e_Dictionary
| PDF dictionary object.
static | e_InvalidType
| Enumeration for PDF object type. More...
static | e_Name
| PDF name object.
static | e_Null
| PDF null object.
static | e_Number
| PDF number object.
static | e_Reference
| PDF reference object.
static | e_Stream
| PDF stream object.
static | e_String
| PDF string object.

## Detailed Description

PDF supports eight basic types of objects:
"Boolean value", "Integer and real number", "String", "Name", "Array", "Dictionary", "Stream", "The null object". For more details about PDF objects, please refer to Section 3.2 "Objects" in <PDF Reference 1.7>.
Class FSDK.PDFObject is a base class for all kinds of PDF objects. It offers different functions to create different kind of PDF objects. For "Array", "Dictionary" and "Stream" PDF object, please refer to derived classes FSDK.PDFArray, FSDK.PDFDictionary and FSDK.PDFStream.
If user wants to make a newly created PDF object to be an indirect object, please call function FSDK.PDFDoc.AddIndirectObject.

See also
  FSDK.PDFArray
  FSDK.PDFDictionary
  FSDK.PDFStream
  FSDK.PDFDoc

## Member Function Documentation

## ◆ CloneObject()

FSDK.PDFObject.CloneObject | ( |  | ) |

Clone current PDF object and get the cloned PDF object.

Please call FSDK.PDFObject.Release to release the new 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 FSDK.PDFObject object as the clone result. If there is any error, this function will return null.

## ◆ CreateFromBoolean()

static FSDK.PDFObject.CreateFromBoolean | ( | boolean_value |  | ) |
| static

Create a PDF object from a boolean value.

Please call function FSDK.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.

Parameters

  [in] | boolean_value | A boolean value.

Returns
  A new FSDK.PDFObject object, whose object type is FSDK.PDFObject.e_Boolean. If there is any error, this function will return null.

## ◆ CreateFromDateTime()

static FSDK.PDFObject.CreateFromDateTime | ( | date_time |  | ) |
| static

Create a PDF object from date time.

PDF defines a standard date format, which closely follows that of the international standard ASN.1 (Abstract Syntax Notation One), defined in ISO/ IEC 8824 (see the Bibliography). A date is defined as an ASCII string of the form (D:YYYYMMDDHHmmSSOHH'mm'). Please call function FSDK.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.

Parameters

  [in] | date_time | A date and time object.

Returns
  A new FSDK.PDFObject object, whose object type is FSDK.PDFObject.e_String. If there is any error, this function will return null.

## ◆ CreateFromFloat()

static FSDK.PDFObject.CreateFromFloat | ( | float_value |  | ) |
| static

Create a PDF object from a float number.

Please call function FSDK.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.

Parameters

  [in] | float_value | A float value.

Returns
  A new FSDK.PDFObject object, whose object type is FSDK.PDFObject.e_Number. If there is any error, this function will return null.

## ◆ CreateFromInteger()

static FSDK.PDFObject.CreateFromInteger | ( | integer_value |  | ) |
| static

Create a PDF object from a integer number.

Please call function FSDK.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.

Parameters

  [in] | integer_value | An integer value.

Returns
  A new FSDK.PDFObject object, whose object type is FSDK.PDFObject.e_Number. If there is any error, this function will return null.

## ◆ CreateFromName()

static FSDK.PDFObject.CreateFromName | ( | name |  | ) |
| static

Create a PDF object from a string which represents a name.

Please call function FSDK.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.

Parameters

  [in] | name | A string. It should not be an empty string.

Returns
  A new FSDK.PDFObject object, whose object type is FSDK.PDFObject.e_Name. If there is any error, this function will return null.

## ◆ CreateFromNameW()

static FSDK.PDFObject.CreateFromNameW | ( | name |  | ) |
| static

Create a PDF object from a string which represents a name.

Please call function FSDK.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.

Parameters

  [in] | name | A string. It should not be an empty string.

Returns
  A new FSDK.PDFObject object, whose object type is FSDK.PDFObject.e_Name. If there is any error, this function will return null.

## ◆ CreateFromString() [1/2]

static FSDK.PDFObject.CreateFromString | ( | string_value |  | ) |
| static

Create a PDF object from string.

Please call function FSDK.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.

Parameters

  [in] | string_value | A string. It should not be an empty string.

Returns
  A FSDK.PDFObject object, whose object type is FSDK.PDFObject.e_String. If there is any error, this function will return null.

## ◆ CreateFromString() [2/2]

static FSDK.PDFObject.CreateFromString | ( | string_value | ,
|  | length |
| ) |  |
| static

Create a PDF object from string.

Please call function FSDK.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.

Parameters

  [in] | string_value | A string. It should not be an empty string.
  [in] | length | The length of the wide character string. The length should either be a positive value or -1. A value of -1 represents a zero-terminated wide character string.

Returns
  A FSDK.PDFObject object, whose object type is FSDK.PDFObject.e_String. If there is any error, this function will return null.

## ◆ CreateReference()

static FSDK.PDFObject.CreateReference | ( | document | ,
|  | object_number |
| ) |  |
| static

Create a reference for an indirect object.

The indirect object can be retrieved by following methods:

- Returned by function FSDK.PDFDoc.GetIndirectObject.
- Returned by function FSDK.PDFDoc.AddIndirectObject, when try to add a direct PDF object to PDF document and make it to be an indirect object.

Please call function FSDK.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.

Parameters

  [in] | document | A valid PDF document object.
  [in] | object_number | The indirect object number of the indirect PDF object. This should be above 0.

Returns
  A new FSDK.PDFObject object, whose object type is FSDK.PDFObject.e_Reference. If there is any error, this function will return null.

## ◆ DeepCloneObject()

FSDK.PDFObject.DeepCloneObject | ( |  | ) |

Clone current PDF object and get the cloned PDF object.

This function is a totally direct copy, without any reference object inside, so the copy object can be copied to another document. Please call FSDK.PDFObject.Release to release the new 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 FSDK.PDFObject object as the clone result. If there is any error, this function will return null.

## ◆ GetArray()

FSDK.PDFObject.GetArray | ( |  | ) |

Get the PDF array object of current PDF object.

If the type of current PDF object is FSDK.PDFObject.e_Reference, this function will check the direct PDF object of current PDF object.

Returns
  A PDF array object. If current PDF object or the direct PDF object is not a PDF array, null will be returned.

## ◆ GetBoolean()

FSDK.PDFObject.GetBoolean | ( |  | ) |

Get the boolean value of current PDF object.

Only useful when the type of current PDF object is FSDK.PDFObject.e_Boolean.

Returns
  The boolean value. For PDF object in other type, false will be returned.

## ◆ GetDateTime()

FSDK.PDFObject.GetDateTime | ( |  | ) |

Get the date time value of current PDF object.

Only useful when the type of current PDF objec is FSDK.PDFObject.e_String and its content is in PDF standard date format.

Returns
  The data time information. If there is any error or current object is in other type, an empty date and time object will be returned.

## ◆ GetDict()

FSDK.PDFObject.GetDict | ( |  | ) |

Get the PDF dictionary object of current PDF object.

If the type of current PDF object is FSDK.PDFObject.e_Reference, this function will check the direct PDF object of current PDF object.

Returns
  A PDF dictionary object. If current PDF object or the direct PDF object is not a PDF dictionary, null will be returned.

## ◆ GetDirectObject()

FSDK.PDFObject.GetDirectObject | ( |  | ) |

Get the direct object of current PDF object.

If the type of current PDF object is FSDK.PDFObject.e_Reference, the direct object will be returned.

Returns
  The direct PDF object. For PDF object in other type, this function will return current PDF object itself. If there is any error, this function will return null.

## ◆ GetFloat()

FSDK.PDFObject.GetFloat | ( |  | ) |

Get the float value of current PDF object.

Only useful when the type of current PDF object is FSDK.PDFObject.e_Number.

Returns
  The float value. For PDF object in other type, 0.0f will be returned.

## ◆ GetInteger()

FSDK.PDFObject.GetInteger | ( |  | ) |

Get the integer value of current PDF object.

Only useful when the type of current PDF object is FSDK.PDFObject.e_Number.

Returns
  The integer value. For PDF object in other type, 0 will be returned.

## ◆ GetMatrix()

FSDK.PDFObject.GetMatrix | ( |  | ) |

Get the matrix value of current PDF object.

Only useful for PDF object whose type is FSDK.PDFObject.e_Array and it has 6 number objects as elements.

Returns
  A matrix. If there is any error or current object is in other type, a matrix with value [0 0 0 0 0 0] will be returned.

## ◆ GetName()

FSDK.PDFObject.GetName | ( |  | ) |

Get the name value of current PDF object.

Only useful when the type of current PDF object is FSDK.PDFObject.e_Name or FSDK.PDFObject.e_String.

Returns
  A string that represents the value. If there is any error or current object is in other type, an empty string will be returned.

## ◆ GetObjNum()

FSDK.PDFObject.GetObjNum | ( |  | ) |

Get the indirect object number of current PDF object.

Returns
  The indirect object number. It would be:
  - 0 if current PDF object is a direct object.
  - above 0 if current PDF object is an indirect object.
  - -1 means there is any error.

## ◆ GetRect()

FSDK.PDFObject.GetRect | ( |  | ) |

Get the rectangle value of current PDF object.

Only useful for PDF object whose type is FSDK.PDFObject.e_Array and it has 4 number objects as elements.

Returns
  A rectangle. If there is any error or current object is in other type, a rectangle with value [0 0 0 0] will be returned.

## ◆ GetStream()

FSDK.PDFObject.GetStream | ( |  | ) |

Get the PDF stream object of current PDF object.

If the type of current PDF object is FSDK.PDFObject.e_Reference, this function will check the direct PDF object of current PDF object.

Returns
  A PDF stream object. If current PDF object or the direct PDF object is not a PDF stream, null will be returned.

## ◆ GetString()

FSDK.PDFObject.GetString | ( |  | ) |

Get the string value of current PDF object.

This function will get the string format for actual value of current PDF object:

- If object type is FSDK.PDFObject.e_Boolean, "true" or "false" string value will be returned, depending on its actual value.
- If object type is FSDK.PDFObject.e_Number, the value will be represents as a string. For example, "1.5" string is for value 1.5.
- If object type is FSDK.PDFObject.e_String, the string value will be retrieved directly.

If value of current PDF object cannot be converted to a valid string, an empty string will be returned.

Returns
  A string.

## ◆ GetType()

FSDK.PDFObject.GetType | ( |  | ) |

Get the type of current PDF object.

Returns
  PDF object type. Please refer to values starting from FSDK.PDFObject.e_Boolean and this would be one of these values.

## ◆ GetWideString()

FSDK.PDFObject.GetWideString | ( |  | ) |

Get the wide string value of current PDF object.

This function will get the string format for actual value of current PDF object:

- If object type is FSDK.PDFObject.e_Boolean, "true" or "false" string value will be returned, depending on its actual value.
- If object type is FSDK.PDFObject.e_Number, the value will be represents as a string. For example, "1.5" string is for value 1.5.
- If object type is FSDK.PDFObject.e_String, the string value will be retrieved directly.

If value of current PDF object cannot be converted to a valid string, an empty string will be returned.

Returns
  A string.

## ◆ IsIdentical()

FSDK.PDFObject.IsIdentical | ( | pdf_obj |  | ) |

Check if input PDF object is identical with current PDF object.

Parameters

  [in] | pdf_obj | Another PDF object which is to be check with current PDF object.

Returns
  true means input PDF object is identical with current PDF object, while false means input PDF object is not identical with current PDF object.

## ◆ Release()

FSDK.PDFObject.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.

This function should be called only for a newly created PDF object or a cloned PDF object, which has not been added or set to other PDF object or related to PDF document, and will not be used any more. Please do not use this function for other case, otherwise unknown error may occur.

Returns
  None.

## Member Data Documentation

## ◆ e_InvalidType

FSDK.PDFObject.e_InvalidType
| static

Enumeration for PDF object type.

Values of this enumeration should be used alone.

Invalid PDF object type.