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

PdfField PoDoFo::PdfPage::GetField ( int  index )

Get a PdfField with a certain index.

indexof the PdfField (must be smaller than GetNumFields() )
See also:
a PdfField

Definition at line 534 of file PdfPage.cpp.

References PoDoFo::ePdfError_ValueOutOfRange, GetAnnotation(), PoDoFo::PdfVariant::GetDictionary(), GetNumAnnots(), PoDoFo::PdfElement::GetObject(), PoDoFo::PdfAnnotation::GetType(), PoDoFo::PdfDictionary::HasKey(), and PODOFO_RAISE_ERROR.

Referenced by GetField().

    int            nCount  = 0;
    int            nAnnots = this->GetNumAnnots();
    PdfAnnotation* pAnnot  = NULL;
    for( int i=0;i<nAnnots;i++ )
        pAnnot = this->GetAnnotation( i );
        // Count every widget annotation with a FieldType as PdfField
        if( pAnnot->GetType() == ePdfAnnotation_Widget && 
            pAnnot->GetObject()->GetDictionary().HasKey( PdfName("FT") ) )
            if( nCount == index )
                return PdfField( pAnnot->GetObject(), pAnnot );

    PODOFO_RAISE_ERROR( ePdfError_ValueOutOfRange );

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