Hi Ian,

This should be pretty simple to do:


    PdfMemDocument doc( pszInFilename );
    PdfPage*       pPage;
    PdfRect        rect;
    int            i;

    for(i=0;i<doc.GetPageCount();i++)
    {
        pPage = doc.GetPage( i );
        if( !pPage ) 
        {
            PODOFO_RAISE_ERROR( ePdfError_InvalidHandle );
        }
        

        // pSound has to be a sound PdfObject (see PDF Reference "9.2 Sounds")
        rect = PdfRect( YOUR_SIZE );
        PdfAnnotation* Annot = pPage->CreateAnnotation( ePdfAnnotation_Sound, 
rect );
        pAnnot->GetObject()->GetDictionary().AddKey( PdfName("Sound"), 
pSound->Reference() );
    }

    doc.Write( pszOutFilename );

Should be all you need.

Am Wednesday 08 August 2007 schrieb Ian:
> Hi Dom,
>
> Thanks very much for the clear example of how to add javascript to a
> button!
>
> A further question: how simple is it using PoDoFo to open an existing
> PDF file, add a multimedia annotation onto some existing page, without
> disturbing other content already on the page? I guess this must involve
> PoDoFo::PdfParser()? I saw in some notes that PdfPainter() is able to
> add to an existing page, so this must be related?
> So, is it possible to use PdfAnnotation::GetObject()->GetDictionary().Ad
> dKey( ... ) on an existing page in an existing PDF file?
>
> Thanks,
> Ian



-- 
**********************************************************************
Dominik Seichter - [EMAIL PROTECTED]
KRename  - http://www.krename.net  - Powerful batch renamer for KDE
KBarcode - http://www.kbarcode.net - Barcode and label printing
PoDoFo - http://podofo.sf.net - PDF generation and parsing library
SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game,  for KDE
Alan - http://alan.sf.net - A Turing Machine in Java
**********************************************************************

Attachment: pgpztIQHT4zVq.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to