Logo Search packages:      
Sourcecode: libpodofo version File versions  Download package

PoDoFo::PdfImmediateWriter::PdfImmediateWriter ( PdfOutputDevice pDevice,
PdfVecObjects pVecObjects,
const PdfObject pTrailer,
EPdfVersion  eVersion = ePdfVersion_1_5,
PdfEncrypt pEncrypt = NULL,
EPdfWriteMode  eWriteMode = ePdfWriteMode_Default 
)

Create a new PdfWriter that writes objects with streams immediately to a PdfOutputDevice

This has the advantage that large documents can be created without having to keep the whole document in memory.

Parameters:
pDeviceall stream streams are immediately written to this output device while the document is created.
pVecObjectsa vector of objects containing the objects which are written to disk
pTrailerthe trailer object
eVersionthe PDF version of the document to write. The PDF version can only be set in the constructor as it is the first item written to the document on disk.
pEncryptpointer to an encryption object or NULL. If not NULL the PdfEncrypt object will be copied and used to encrypt the created document.
eWriteModeadditional options for writing the pdf

Definition at line 32 of file PdfImmediateWriter.cpp.

References PoDoFo::PdfVecObjects::Attach(), PoDoFo::PdfWriter::CreateFileIdentifier(), PoDoFo::PdfEncrypt::GenerateEncryptionKey(), PoDoFo::PdfWriter::m_pEncrypt, PoDoFo::PdfWriter::m_vecObjects, PoDoFo::PdfWriter::SetEncrypted(), PoDoFo::PdfWriter::SetPdfVersion(), PoDoFo::PdfVecObjects::SetStreamFactory(), PoDoFo::PdfWriter::SetWriteMode(), and PoDoFo::PdfWriter::WritePdfHeader().

    : PdfWriter( pVecObjects ), m_pParent( pVecObjects ), 
      m_pDevice( pDevice ), m_pLast( NULL ), m_bOpenStream( false )
{
    if( m_pTrailer )
        delete m_pTrailer;
    m_pTrailer = new PdfObject( *pTrailer );

    // register as observer for PdfVecObjects
    m_pParent->Attach( this );
    // register as stream factory for PdfVecObjects
    m_pParent->SetStreamFactory( this );

    this->CreateFileIdentifier( m_identifier, m_pTrailer );
    // setup encryption
    if( pEncrypt )
    {
        this->SetEncrypted( *pEncrypt );
        m_pEncrypt->GenerateEncryptionKey( m_identifier );
    }

    // start with writing the header
    this->SetPdfVersion( eVersion );
    this->SetWriteMode( eWriteMode );
    this->WritePdfHeader( m_pDevice );

    m_pXRef = m_bXRefStream ? new PdfXRefStream( m_vecObjects, this ) : new PdfXRef();

}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index