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

PdfAcroForm * PoDoFo::PdfDocument::GetAcroForm ( bool  bCreate = ePdfCreateObject,
PdfAcroForm::EPdfAcroFormDefaulAppearance  eDefaultAppearance = PdfAcroForm::ePdfAcroFormDefaultAppearance_BlackText12pt 
) [inherited]

Get access to the AcroForm dictionary

Parameters:
bCreatecreate the object if it does not exist (ePdfCreateObject) or return NULL if it does not exist
eDefaultAppearancespecifies if a default appearence shall be created
Returns:
PdfObject the AcroForm dictionary

Definition at line 688 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().

{
    PdfObject* pObj;

    if( !m_pAcroForms )
    {
        pObj = GetNamedObjectFromCatalog( "AcroForm" );
        if( !pObj ) 
        {
            if ( !bCreate )   return NULL;
            
            m_pAcroForms = new PdfAcroForm( this, eDefaultAppearance );
            this->GetCatalog()->GetDictionary().AddKey( "AcroForm", m_pAcroForms->GetObject()->Reference() );
        } else if ( pObj->GetDataType() != ePdfDataType_Dictionary ) {
            PODOFO_RAISE_ERROR( ePdfError_InvalidDataType );
        } else
            m_pAcroForms = new PdfAcroForm( this, pObj, eDefaultAppearance );
    }        
    
    return m_pAcroForms;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index