Public Types | |
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... | |
Public Member Functions | |
PDFObject * | CloneObject () const |
Clone current PDF object and get the cloned PDF object. More... | |
PDFArray * | GetArray () |
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... | |
PDFDictionary * | GetDict () |
Get the PDF dictionary object of current PDF object. More... | |
PDFObject * | GetDirectObject () 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... | |
PDFStream * | GetStream () |
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... | |
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 PDFObject * | CreateFromBoolean (bool boolean_value) |
Create a PDF object from a boolean value. More... | |
static PDFObject * | CreateFromDateTime (const 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 (const char *name) |
Create a PDF object from a string which represents a name. More... | |
static PDFObject * | CreateFromString (const wchar_t *string_value) |
Create a PDF object from string. More... | |
static PDFObject * | CreateReference (PDFDoc document, uint32 object_number) |
Create a reference for an indirect object. More... | |
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 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 PDFArray, PDFDictionary and PDFStream.
If user wants to make a newly created PDF object to be an indirect object, please call function pdf::PDFDoc::AddIndirectObject.
Enumeration for PDF object type.
Values of this enumeration should be used alone.
PDFObject* foxit::pdf::objects::PDFObject::CloneObject | ( | ) | const |
Clone current PDF object and get the cloned PDF object.
|
static |
Create a PDF object from a boolean value.
[in] | boolean_value | A boolean value. |
|
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').
[in] | date_time | A DateTime object. |
|
static |
Create a PDF object from a float number.
[in] | float_value | A float value. |
|
static |
Create a PDF object from a integer number.
[in] | integer_value | An integer value. |
|
static |
Create a PDF object from a string which represents a name.
[in] | name | A string. It should not be an empty string. |
|
static |
Create a PDF object from string.
[in] | string_value | A string. It should not be an empty string. |
|
static |
Create a reference for an indirect object.
The indirect object can be retrieved by following methods:
[in] | document | A valid PDF document object. |
[in] | object_number | The indirect object number of the indirect PDF object. This should be above 0. |
PDFArray* foxit::pdf::objects::PDFObject::GetArray | ( | ) |
Get the PDF array object of current PDF object.
If the type of current PDF object is PDFObject::e_Reference, this function will check the direct PDF object of current PDF object.
bool foxit::pdf::objects::PDFObject::GetBoolean | ( | ) | const |
Get the boolean value of current PDF object.
Only useful when the type of current PDF object is PDFObject::e_Boolean.
DateTime foxit::pdf::objects::PDFObject::GetDateTime | ( | ) | const |
Get the date time value of current PDF object.
Only useful when the type of current PDF objec is PDFObject::e_String and its content is in PDF standard date format.
PDFDictionary* foxit::pdf::objects::PDFObject::GetDict | ( | ) |
Get the PDF dictionary object of current PDF object.
If the type of current PDF object is PDFObject::e_Reference, this function will check the direct PDF object of current PDF object.
PDFObject* foxit::pdf::objects::PDFObject::GetDirectObject | ( | ) | const |
Get the direct object of current PDF object.
If the type of current PDF object is PDFObject::e_Reference, the direct object will be returned.
float foxit::pdf::objects::PDFObject::GetFloat | ( | ) | const |
Get the float value of current PDF object.
Only useful when the type of current PDF object is PDFObject::e_Number.
int foxit::pdf::objects::PDFObject::GetInteger | ( | ) | const |
Get the integer value of current PDF object.
Only useful when the type of current PDF object is PDFObject::e_Number.
Matrix foxit::pdf::objects::PDFObject::GetMatrix | ( | ) | const |
Get the matrix value of current PDF object.
Only useful for PDF object whose type is PDFObject::e_Array and it has 6 number objects as elements.
String foxit::pdf::objects::PDFObject::GetName | ( | ) | const |
Get the name value of current PDF object.
Only useful when the type of current PDF object is PDFObject::e_Name or PDFObject::e_String.
uint32 foxit::pdf::objects::PDFObject::GetObjNum | ( | ) | const |
Get the indirect object number of current PDF object.
RectF foxit::pdf::objects::PDFObject::GetRect | ( | ) | const |
Get the rectangle value of current PDF object.
Only useful for PDF object whose type is PDFObject::e_Array and it has 4 number objects as elements.
PDFStream* foxit::pdf::objects::PDFObject::GetStream | ( | ) |
Get the PDF stream object of current PDF object.
If the type of current PDF object is PDFObject::e_Reference, this function will check the direct PDF object of current PDF object.
String foxit::pdf::objects::PDFObject::GetString | ( | ) | const |
Get the string value of current PDF object.
This function will get the string format for actual value of current PDF object:
If value of current PDF object cannot be converted to a valid string, an empty string will be returned.
Type foxit::pdf::objects::PDFObject::GetType | ( | ) | const |
Get the type of current PDF object.
WString foxit::pdf::objects::PDFObject::GetWideString | ( | ) | const |
Get the wide string value of current PDF object.
This function will get the string format for actual value of current PDF object:
If value of current PDF object cannot be converted to a valid string, an empty string will be returned.
void foxit::pdf::objects::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.