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

PdfObject * PoDoFo::PdfWriter::CreateLinearizationDictionary (  ) [private]

Create a linearization dictionary for the current document and return a pointer to it after inserting it into the vector of PdfObjects

a pointer to the linearization dictionary

Definition at line 337 of file PdfWriter.cpp.

References PoDoFo::PdfDictionary::AddKey(), PoDoFo::PdfVecObjects::CreateObject(), PoDoFo::PdfVariant::GetDictionary(), PoDoFo::PdfPagesTree::GetTotalNumberOfPages(), m_vecObjects, and PoDoFo::PdfArray::push_back().

    PdfObject*       pLinearize        = m_vecObjects->CreateObject();

    // This will be overwritten later with valid data!
    PdfVariant place_holder( PdfData( LINEARIZATION_PADDING ) );

    PdfArray array;
    array.push_back( place_holder );
    array.push_back( place_holder );

    pLinearize->GetDictionary().AddKey( "Linearized", 1.0 );  // Version
    pLinearize->GetDictionary().AddKey( "L", place_holder );  // File length
    pLinearize->GetDictionary().AddKey( "H", array );         // Hint stream offset and length as PdfArray
    pLinearize->GetDictionary().AddKey( "E", place_holder );  // Offset of end of first page
    pLinearize->GetDictionary().AddKey( "N",                  // Number of pages in the document 
                                        static_cast<pdf_int64>(m_pPagesTree->GetTotalNumberOfPages()) );             
    pLinearize->GetDictionary().AddKey( "O", place_holder );  // Object number of the first page
    pLinearize->GetDictionary().AddKey( "T", place_holder );  // Offset of first entry in main cross reference table

    return pLinearize;

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index