#include <PdfObject.h>
Inheritance diagram for PoDoFo::PdfObject:
Public Member Functions | |
PdfObject () | |
PdfObject (const PdfReference &rRef, const char *pszType) | |
PdfObject (const PdfReference &rRef, const PdfVariant &rVariant) | |
PdfObject (const PdfVariant &var) | |
PdfObject (bool b) | |
PdfObject (pdf_int64 l) | |
PdfObject (double d) | |
PdfObject (const PdfString &rsString) | |
PdfObject (const PdfName &rName) | |
PdfObject (const PdfReference &rRef) | |
PdfObject (const PdfArray &tList) | |
PdfObject (const PdfDictionary &rDict) | |
PdfObject (const PdfObject &rhs) | |
PdfObject * | GetIndirectKey (const PdfName &key) const |
PdfObject * | MustGetIndirectKey (const PdfName &key) const |
void | WriteObject (PdfOutputDevice *pDevice, EPdfWriteMode eWriteMode, PdfEncrypt *pEncrypt, const PdfName &keyStop=PdfName::KeyNull) const |
pdf_long | GetObjectLength (EPdfWriteMode eWriteMode) |
const PdfReference & | Reference () const |
PdfStream * | GetStream () |
const PdfStream * | GetStream () const |
bool | HasStream () const |
PODOFO_NOTHROW bool | operator< (const PdfObject &rhs) const |
PODOFO_NOTHROW bool | operator== (const PdfObject &rhs) const |
void | SetOwner (PdfVecObjects *pVecObjects) |
PdfVecObjects * | GetOwner () const |
const PdfObject & | operator= (const PdfObject &rhs) |
void | FlateCompressStream () |
pdf_long | GetByteOffset (const char *pszKey, EPdfWriteMode eWriteMode) |
void | DelayedStreamLoad () const |
Protected Member Functions | |
void | EnableDelayedStreamLoading () |
virtual void | DelayedStreamLoadImpl () |
PdfStream * | GetStream_NoDL () |
It is possible to manipulate the stream which can be appended to the object (if the object is of underlying type dictionary). A PdfObject is uniquely identified by an object number and a generation number which has to be passed to the constructor.
The object can be written to a file easily using the WriteObject() function.
PoDoFo::PdfObject::PdfObject | ( | ) |
Create a PDF object with object and generation number -1 and the value of being an empty PdfDictionary.
PoDoFo::PdfObject::PdfObject | ( | const PdfReference & | rRef, | |
const char * | pszType | |||
) |
Construct a new PDF object of type PdfDictionary.
rRef | reference of this object | |
pszType | if type is not null a key "/Type" will be added to the dictionary with the value of type. |
PoDoFo::PdfObject::PdfObject | ( | const PdfReference & | rRef, | |
const PdfVariant & | rVariant | |||
) |
Construct a new PDF object.
rRef | reference of this object | |
rVariant | the value of the PdfObject (which is copied) |
PoDoFo::PdfObject::PdfObject | ( | const PdfVariant & | var | ) |
Create a PDF object with object and generation number -1 and the value of the passed variant.
var | the value of the object |
PoDoFo::PdfObject::PdfObject | ( | bool | b | ) |
PoDoFo::PdfObject::PdfObject | ( | pdf_int64 | l | ) |
PoDoFo::PdfObject::PdfObject | ( | double | d | ) |
PoDoFo::PdfObject::PdfObject | ( | const PdfString & | rsString | ) |
PoDoFo::PdfObject::PdfObject | ( | const PdfName & | rName | ) |
PoDoFo::PdfObject::PdfObject | ( | const PdfReference & | rRef | ) |
Construct a PdfObject with object and generation number -1 and a PdfReference as value.
rRef | the value of the this PdfObject |
PoDoFo::PdfObject::PdfObject | ( | const PdfArray & | tList | ) |
PoDoFo::PdfObject::PdfObject | ( | const PdfDictionary & | rDict | ) |
PoDoFo::PdfObject::PdfObject | ( | const PdfObject & | rhs | ) |
void PoDoFo::PdfObject::DelayedStreamLoad | ( | ) | const [inline] |
Dynamically load this object and any associated stream from a PDF file by calling the virtual method DelayedStreamLoadImpl if the stream is not already loaded. Will call DelayedLoad() first if it is required.
Call graph:
DelayedStreamLoad ---> DelayedLoad() --> DelayedLoadImpl() | --> DelayedStreamLoadImpl()
For objects complete created in memory this function does nothing.
void PoDoFo::PdfObject::DelayedStreamLoadImpl | ( | ) | [inline, protected, virtual] |
Load the stream of the object if it has one and if delayed loading is enabled.
You should override this to control deferred stream loading in your subclass.
Never call this method directly; use DelayedStreamLoad() instead.
Reimplemented in PoDoFo::PdfParserObject.
void PoDoFo::PdfObject::EnableDelayedStreamLoading | ( | ) | [inline, protected] |
Flag any stream associated with the object as incompletely loaded, so that DelayedStreamLoad() will be called when needed.
All constructors initialize a PdfObject with delayed loading of streams disabled . If you want delayed loading of streams you must ask for it. If you do so, call this method early in your ctor and be sure to override DelayedStreamLoadImpl()
Note that it is quite possible to have a PdfObject that requires a delayed-load of its stream but does an immediate load of the PdfVariant base. If you want to delay loading of that too, make sure to call EnableDelayedLoading().
void PoDoFo::PdfObject::FlateCompressStream | ( | ) |
This function compresses any currently set stream using the FlateDecode algorithm. JPEG compressed streams will not be compressed again using this function. Entries to the filter dictionary will be added if necessary.
pdf_long PoDoFo::PdfObject::GetByteOffset | ( | const char * | pszKey, | |
EPdfWriteMode | eWriteMode | |||
) |
Calculate the byte offset of the key pszKey from the start of the object if the object was written to disk at the moment of calling this function.
This function is very calculation intensive!
pszKey | key to calculate the byte offset | |
eWriteMode | additional options for writing the PDF |
Get the keys value out of the dictionary. If the key is a reference, the reference is resolved and the object pointed to by the reference is returned.
key | look for the key named key in the dictionary |
pdf_long PoDoFo::PdfObject::GetObjectLength | ( | EPdfWriteMode | eWriteMode | ) |
Get the length of the object in bytes if it was written to disk now.
eWriteMode | additional options for writing the object |
PdfVecObjects * PoDoFo::PdfObject::GetOwner | ( | ) | const [inline] |
Get the owner of this object.
const PdfStream * PoDoFo::PdfObject::GetStream | ( | ) | const |
Get a handle to a const PDF stream object If the PDF object does not have a stream, null is returned
PdfStream * PoDoFo::PdfObject::GetStream | ( | ) |
PdfStream * PoDoFo::PdfObject::GetStream_NoDL | ( | ) | [protected] |
Same as GetStream() but won't trigger a delayed load, so it's safe for use while a delayed load is in progress.
This will set the dirty flag of this object.
bool PoDoFo::PdfObject::HasStream | ( | ) | const [inline] |
MustGetIndirectKey() wraps GetIndirectKey to throw on null return. This makes it MUCH more readable to look up deep chains of linked keys with the cost that it's not easy to tell at which point a missing key/object was encountered.
PdfError(ePdfError_NoObject) | . |
bool PoDoFo::PdfObject::operator< | ( | const PdfObject & | rhs | ) | const [inline] |
This operator is required for sorting a list of PdfObjects. It compares the objectnumber. If objectnumbers are equal, the generation number is compared.
bool PoDoFo::PdfObject::operator== | ( | const PdfObject & | rhs | ) | const [inline] |
Comperasion operator. Compares two PDF object only based on their object and generation number
const PdfReference & PoDoFo::PdfObject::Reference | ( | ) | const [inline] |
Get a indirect reference to this object
void PoDoFo::PdfObject::SetOwner | ( | PdfVecObjects * | pVecObjects | ) | [inline] |
Set the owner of this object, i.e. the PdfVecObjects to which this object belongs.
pVecObjects | a vector of pdf objects |
void PoDoFo::PdfObject::WriteObject | ( | PdfOutputDevice * | pDevice, | |
EPdfWriteMode | eWriteMode, | |||
PdfEncrypt * | pEncrypt, | |||
const PdfName & | keyStop = PdfName::KeyNull | |||
) | const |
Write the complete object to a file.
pDevice | write the object to this device | |
pEncrypt | an encryption object which is used to encrypt this object or NULL to not encrypt this object | |
eWriteMode | additional options for writing the object | |
keyStop | if not KeyNull and a key == keyStop is found writing will stop right before this key! |