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

PoDoFo::PdfAnnotation::PdfAnnotation ( PdfPage pPage,
EPdfAnnotation  eAnnot,
const PdfRect rRect,
PdfVecObjects pParent 

Create a new annotation object

pPagethe parent page of this annotation
eAnnottype of the annotation
rRectthe rectangle in which the annotation will appear on the page
pParentparent of this annotation
See also:

Definition at line 66 of file PdfAnnotation.cpp.

References PoDoFo::PdfDictionary::AddKey(), PoDoFo::ePdfError_InvalidHandle, PoDoFo::PdfVariant::GetDictionary(), PoDoFo::PdfName::GetLength(), PoDoFo::PdfElement::GetObject(), PODOFO_RAISE_ERROR, PoDoFo::PdfObject::Reference(), s_lNumActions, PoDoFo::PdfDate::ToString(), PoDoFo::PdfRect::ToVariant(), and PoDoFo::PdfElement::TypeNameForIndex().

    : PdfElement( "Annot", pParent ), m_eAnnotation( eAnnot ), m_pAction( NULL ), m_pFileSpec( NULL ), m_pPage( pPage )
    PdfVariant    rect;
    PdfDate       date;
    PdfString     sDate;
    const PdfName name( TypeNameForIndex( eAnnot, s_names, s_lNumActions ) );

    if( !name.GetLength() )
        PODOFO_RAISE_ERROR( ePdfError_InvalidHandle );

    rRect.ToVariant( rect );

    this->GetObject()->GetDictionary().AddKey( PdfName::KeyRect, rect );

    rRect.ToVariant( rect );
    date.ToString( sDate );
    this->GetObject()->GetDictionary().AddKey( PdfName::KeySubtype, name );
    this->GetObject()->GetDictionary().AddKey( PdfName::KeyRect, rect );
    this->GetObject()->GetDictionary().AddKey( "P", pPage->GetObject()->Reference() );
    this->GetObject()->GetDictionary().AddKey( "M", sDate );

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index