PoDoFo
0.9.6
|
#include <PdfElement.h>
Public Member Functions | |
PdfObject * | GetObject () |
const PdfObject * | GetObject () const |
Protected Member Functions | |
PdfElement (const char *pszType, PdfVecObjects *pParent) | |
PdfElement (const char *pszType, PdfDocument *pParent) | |
PdfElement (const char *pszType, PdfObject *pObject) | |
PdfElement (EPdfDataType eExpectedDataType, PdfObject *pObject) | |
const char * | TypeNameForIndex (int i, const char **ppTypes, long lLen) const |
int | TypeNameToIndex (const char *pszType, const char **ppTypes, long lLen, int nUnknownValue) const |
PdfObject * | CreateObject (const char *pszType=NULL) |
PdfObject * | GetNonConstObject () const |
PdfElement is a common base class for all elements in a PDF file. For example pages, action and annotations.
Every PDF element has one PdfObject and provides an easier interface to modify the contents of the dictionary.
A PdfElement base class can be created from an existing PdfObject or created from scratch. In the later case, the PdfElement creates a PdfObject and adds it to a vector of objects.
A PdfElement cannot be created directly. Use one of the subclasses which implement real functionallity.
|
protected |
Creates a new PdfElement
pszType | type entry of the elements object |
pParent | parent vector of objects. Add a newly created object to this vector. |
|
protected |
Creates a new PdfElement
pszType | type entry of the elements object |
pParent | parent PdfDocument. Add a newly created object to this vector. |
|
protected |
Create a PdfElement from an existing PdfObject The object must be a dictionary.
pszType | type entry of the elements object. Throws an exception if the type in the PdfObject differs from pszType. |
pObject | pointer to the PdfObject that is modified by this PdfElement |
|
protected |
Create a PdfElement from an existing PdfObject The object might be of any data type, PdfElement will throw an exception if the PdfObject if not of the same datatype as the expected one. This is necessary in rare cases. E.g. in PdfContents.
eExpectedDataType | the expected datatype of this object |
pObject | pointer to the PdfObject that is modified by this PdfElement |
|
protected |
Create a PdfObject in the parent of this PdfElement which might either be a PdfStreamedDocument, a PdfDocument or a PdfVecObjects
Use this function in an own subclass of PdfElement to create new PdfObjects.
pszType | an optional /Type key of the created object |
|
inlineprotected |
Get access to the internal object. Use this method if you need access to the internal object in a const-method without having to do a const cast.
|
inline |
Get access to the internal object
|
inline |
Get access to the internal object This is an overloaded member function.
|
protected |
Convert an enum or index to its string representation which can be written to the PDF file.
This is a helper function for various PdfElement subclasses that need strings and enums for their SubTypes keys.
i | the index or enum value |
ppTypes | an array of strings containing the string mapping of the index |
lLen | the length of the string array |
|
protected |
Convert a string type to an array index or enum.
This is a helper function for various PdfElement subclasses that need strings and enums for their SubTypes keys.
pszType | the type as string |
ppTypes | an array of strings containing the string mapping of the index |
lLen | the length of the string array |
nUnknownValue | the value that is returned when the type is unknown |