PoDoFo 0.9.20
Public Member Functions | Protected Member Functions | List of all members
PoDoFo::PdfElement Class Reference

#include <PdfElement.h>

Inherited by PoDoFo::PdfArrayElement, and PoDoFo::PdfDictionaryElement.

Public Member Functions

PdfObjectGetObject ()
 
const PdfObjectGetObject () const
 

Protected Member Functions

 PdfElement (PdfObject &obj, PdfDataType expectedDataType)
 

Detailed Description

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.

See also
PdfPage
PdfAction
PdfAnnotation

Constructor & Destructor Documentation

◆ PdfElement()

PdfElement::PdfElement ( PdfObject obj,
PdfDataType  expectedDataType 
)
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.

Parameters
objrefereence to the PdfObject that is modified by this PdfElement
expectedDataTypethe expected datatype of this object

Member Function Documentation

◆ GetObject() [1/2]

PdfObject & PoDoFo::PdfElement::GetObject ( )
inline

Get access to the internal object

Returns
the internal PdfObject

◆ GetObject() [2/2]

const PdfObject & PoDoFo::PdfElement::GetObject ( ) const
inline

Get access to the internal object This is an overloaded member function.

Returns
the internal PdfObject