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

void PoDoFo::PdfWriter::FetchPagesTree (  ) [private]

Initialize m_pPagesTree with its correct value Always call this function befre accessing the pages tree.

Definition at line 492 of file PdfWriter.cpp.

References PoDoFo::ePdfError_InvalidDataType, PoDoFo::ePdfError_InvalidHandle, PoDoFo::PdfVariant::GetDictionary(), PoDoFo::PdfObject::GetIndirectKey(), PoDoFo::PdfDictionary::GetKey(), PoDoFo::PdfVecObjects::GetObject(), PoDoFo::PdfVariant::GetReference(), PoDoFo::PdfVariant::IsReference(), m_vecObjects, and PODOFO_RAISE_ERROR.

{
    if( !m_pPagesTree )
    {
        // try to find the pages tree
        PdfObject* pRoot = m_pTrailer->GetDictionary().GetKey( "Root" );

        if( !pRoot || !pRoot->IsReference() )
        {
            PODOFO_RAISE_ERROR( ePdfError_InvalidDataType );
        }

        /*
        printf("Fetching: %lu\n", pRoot->GetReference().ObjectNumber() );
        printf("Size    : %i\n", static_cast<int>(m_vecObjects->GetSize()) );
        */
        pRoot            = m_vecObjects->GetObject( pRoot->GetReference() );
        if( !pRoot ) 
        {
            PODOFO_RAISE_ERROR( ePdfError_InvalidHandle );
        }

        m_pPagesTree     = new PdfPagesTree( pRoot->GetIndirectKey( "Pages" ) );
    }
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index