Do a full save instead of an incremental one.

However, what version of the XMPToolkit are you using?  I am quite sure that 
the current version will scan from the rear and not the front, for exactly this 
reason...

Leonard

From: Ian Ashley [mailto:[email protected]]
Sent: Friday, August 13, 2010 6:33 AM
To: [email protected]
Subject: [Podofo-users] XMP writing

Dear all,

With Dominik's help I have managed to add/replace XMP in a PDF using the 
following code

       // newXMP is a char * pointing to the new XMP, newXMPLen it is the 
length of the XMP

        PdfObject *xmpObj = podofoDoc->GetObjects().CreateObject("Metadata");
        xmpObj->GetDictionary().AddKey(PdfName("Subtype"), PdfName("XML"));
        xmpObj->GetStream()->Set(newXMP, newXMPLen, TVecFilters());     // no 
filters are provided so that the XMP is output unencoded - this is what the 
Adobe apps do
        podofoDoc->GetCatalog()->GetDictionary().AddKey(PdfName("Metadata"), 
xmpObj->Reference());
        podofoDoc->Write("aFile.pdf");

I found that this leaves the original XMP in the PDF and adds the new XMP at 
the end. This isn't a problem based upon the spec, the XMP found is used 
however the Adobe XMP library handles PDFs very crudely and returns the first 
XMP it finds.

Is there any way to get PoDoFo to only write out the new XMP? Also is it 
possible to get the new XMP written near the start of the file rather than at 
the end?

Thanks in advance,
Ian
------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to