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

PdfOutlines * PoDoFo::PdfDocument::GetOutlines ( bool  bCreate = ePdfCreateObject ) [inherited]

Get access to the Outlines (Bookmarks) dictionary The returned outlines object is owned by the PdfDocument.

Parameters:
bCreatecreate the object if it does not exist (ePdfCreateObject) or return NULL if it does not exist
Returns:
the Outlines/Bookmarks dictionary

Definition at line 641 of file PdfDocument.cpp.

References PoDoFo::PdfDictionary::AddKey(), PoDoFo::ePdfDataType_Dictionary, PoDoFo::ePdfError_InvalidDataType, PoDoFo::PdfDocument::GetCatalog(), PoDoFo::PdfVariant::GetDataType(), PoDoFo::PdfVariant::GetDictionary(), PoDoFo::PdfDocument::GetNamedObjectFromCatalog(), PoDoFo::PdfElement::GetObject(), PODOFO_RAISE_ERROR, and PoDoFo::PdfObject::Reference().

Referenced by PoDoFo::PdfDocument::Append().

{
    PdfObject* pObj;

    if( !m_pOutlines )
    {
        pObj = GetNamedObjectFromCatalog( "Outlines" );
        if( !pObj ) 
        {
            if ( !bCreate )   return NULL;
            
            m_pOutlines = new PdfOutlines( &m_vecObjects );
            this->GetCatalog()->GetDictionary().AddKey( "Outlines", m_pOutlines->GetObject()->Reference() );
        } else if ( pObj->GetDataType() != ePdfDataType_Dictionary ) {
            PODOFO_RAISE_ERROR( ePdfError_InvalidDataType );
        } else
            m_pOutlines = new PdfOutlines( pObj );
    }        
    
    return m_pOutlines;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index