Hi, I am pretty sure podofo does not do any incremental saving, so your code should replace the existing XMP as long as you use PdfMemDocument.
Can you send an example with this problem?
Cheers,
Dominik
Am Freitag 13 August 2010 schrieb Ian Ashley:
> 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
>
--
**********************************************************************
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
**********************************************************************
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ 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
