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

void PoDoFo::PdfPage::DeleteAnnotation ( int  index )

Delete the annotation with index index from this page.

Parameters:
indexthe index of the annotation to delete
See also:
GetNumAnnots

Definition at line 346 of file PdfPage.cpp.

References PoDoFo::ePdfError_InvalidDataType, PoDoFo::ePdfError_ValueOutOfRange, GetAnnotationsArray(), PoDoFo::PdfVariant::GetArray(), PoDoFo::PdfVariant::IsArray(), PODOFO_RAISE_ERROR, and PoDoFo::PdfArray::size().

{
    PdfReference   ref;
    PdfObject*     pObj   = this->GetAnnotationsArray( false );
    
    if( !(pObj && pObj->IsArray()) )
    {
        PODOFO_RAISE_ERROR( ePdfError_InvalidDataType );
    }
    
    if( index < 0 && static_cast<unsigned int>(index) >= pObj->GetArray().size() )
    {
        PODOFO_RAISE_ERROR( ePdfError_ValueOutOfRange );
    }

    ref    = pObj->GetArray()[index].GetReference();

    this->DeleteAnnotation( ref );
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index