PoDoFo 0.9.6
PoDoFo::PdfXRefStream Class Reference

#include <PdfXRefStream.h>

Inheritance diagram for PoDoFo::PdfXRefStream:
PoDoFo::PdfXRef

Public Member Functions

 PdfXRefStream (PdfVecObjects *pParent, PdfWriter *pWriter)
virtual ~PdfXRefStream ()
virtual pdf_uint64 GetOffset () const
Public Member Functions inherited from PoDoFo::PdfXRef
 PdfXRef ()
virtual ~PdfXRef ()
void AddObject (const PdfReference &rRef, pdf_uint64 offset, bool bUsed)
void Write (PdfOutputDevice *pDevice)
pdf_uint32 GetSize () const
void SetFirstEmptyBlock ()

Protected Member Functions

virtual void BeginWrite (PdfOutputDevice *pDevice)
virtual void WriteSubSection (PdfOutputDevice *pDevice, pdf_objnum nFirst, pdf_uint32 nCount)
virtual void WriteXRefEntry (PdfOutputDevice *pDevice, pdf_uint64 offset, pdf_gennum generation, char cMode, pdf_objnum objectNumber=0)
virtual void EndWrite (PdfOutputDevice *pDevice)

Detailed Description

Creates an XRef table that is a stream object. Requires at least PDF 1.5. XRef streams are more compact than normal XRef tables.

This is an internal class of PoDoFo used by PdfWriter.

Constructor & Destructor Documentation

◆ PdfXRefStream()

PoDoFo::PdfXRefStream::PdfXRefStream ( PdfVecObjects * pParent,
PdfWriter * pWriter )

Create a new XRef table

Parameters
pParenta vector of PdfObject is required to create a PdfObject for the XRef
pWriteris needed to fill the trailer directory correctly which is included into the XRef

◆ ~PdfXRefStream()

PoDoFo::PdfXRefStream::~PdfXRefStream ( )
virtual

Destruct the XRef table

Member Function Documentation

◆ BeginWrite()

void PoDoFo::PdfXRefStream::BeginWrite ( PdfOutputDevice * pDevice)
protectedvirtual

Called at the start of writing the XRef table. This method can be overwritten in subclasses to write a general header for the XRef table.

Parameters
pDevicethe output device to which the XRef table should be written.

Reimplemented from PoDoFo::PdfXRef.

◆ EndWrite()

void PoDoFo::PdfXRefStream::EndWrite ( PdfOutputDevice * pDevice)
protectedvirtual

Called at the end of writing the XRef table. Sub classes can overload this method to finish a XRef table.

Parameters
pDevicethe output device to which the XRef table should be written.

Reimplemented from PoDoFo::PdfXRef.

◆ GetOffset()

pdf_uint64 PoDoFo::PdfXRefStream::GetOffset ( ) const
inlinevirtual
Returns
the offset in the file at which the XRef table starts after it was written

Reimplemented from PoDoFo::PdfXRef.

◆ WriteSubSection()

void PoDoFo::PdfXRefStream::WriteSubSection ( PdfOutputDevice * pDevice,
pdf_objnum nFirst,
pdf_uint32 nCount )
protectedvirtual

Begin an XRef subsection. All following calls of WriteXRefEntry belong to this XRef subsection.

Parameters
pDevicethe output device to which the XRef table should be written.
nFirstthe object number of the first object in this subsection
nCountthe number of entries in this subsection

Reimplemented from PoDoFo::PdfXRef.

◆ WriteXRefEntry()

void PoDoFo::PdfXRefStream::WriteXRefEntry ( PdfOutputDevice * pDevice,
pdf_uint64 offset,
pdf_gennum generation,
char cMode,
pdf_objnum objectNumber = 0 )
protectedvirtual

Write a single entry to the XRef table

Parameters
pDevicethe output device to which the XRef table should be written.
offsetthe offset of the object
generationthe generation number
cModethe mode 'n' for object and 'f' for free objects
objectNumberthe object number of the currently written object if cMode = 'n' otherwise undefined

Reimplemented from PoDoFo::PdfXRef.