Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] How to remove XMP Metadata inside Stamper?

Roger Misteli

2005-08-12

Replies:

Hiyas

In a previous life, I added my XMP metadata using this:

   byte[] xmpBuffer = getXMLDocumentAsByteArray();
   PdfStream xmp = new PdfStream(xmpBuffer);
   xmp.put(PdfName.TYPE, PdfName.METADATA);
   xmp.put(PdfName.SUBTYPE, new PdfName("XML"));
   PdfIndirectReference ref = writer.addToBody(xmp).getIndirectReference();
   writer.getExtraCatalog().put(PdfName.METADATA, ref);

which works very nicely.

Now I have a PDF document that contains PDF Form fields which I want to
fill and flatten and that file contains XMP metadata. I want to remove
that metadata and write my own metadata (using the code above) OR, as
alternative (as better alternative actually), I want to merge the two
XML XMP streams (the old one that already exists plus my new one).

Does anyone know how I can do that?

Best regards and thanks
Rog




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.