Hi! thank you very much for the help! Yes, the PdfStamper stamper worked, there is really modified xmp metadata in the output pdf file. But the problem is, the old xmp metadata still exists. Now there are two blocks of xmp metadata in the output pdf file. Now to fix this problem?
Here is the relevant code in my program: PdfReader reader = new PdfReader(inputFile); String metadata = new String(reader.getMetadata()); ... // modify the metadata here PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(output)); stamper.setXmpMetadata(metadata.getBytes()); stamper.close(); Many thanks in advance! Ellen N. Zhao [EMAIL PROTECTED] schrieb: > Quoting Ning Zhao <[EMAIL PROTECTED]>: > > >> Hi all, >> >> by saying >> >> PdfReader reader = new PdfReader(inputFile); >> String xmpmeta = new String(reader.getMetadata()); >> >> I got the xmp metadata of a pdf file as a string. The String xmpmeta is >> then modifed and I want to write the modified content back to the >> original pdf file. The old xmp metadata should be overwritten. How to do >> this with iText? Thanks! >> > > Have you tried the method setXmpMetadata in PdfStamper? > -- > This answer is provided by 1T3XT BVBA > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Register now and save $200. Hurry, offer ends at 11:59 p.m., > Monday, April 7! Use priority code J8TLD2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Do you like iText? > Buy the iText book: http://www.1t3xt.com/docs/book.php > Or leave a tip: https://tipit.to/itexttipjar > -- HaCon Ingenieurgesellschaft mbH Lister Str. 15 30163 Hannover Germany/Deutschland Tel. +49 511 33699-363 Fax. +49 511 33699-99 Email: [EMAIL PROTECTED] http://www.hacon.de Registry Court/Amtsgericht Hannover HRB 1712 Managing Directors/Geschäftsführer: Michael Frankenberg, Dr.-Ing. Marian Gaidzik, Dr.-Ing. Werner Kretschmer, Werner Sommerfeld, Dr.-Ing. Volker Sustrate, Peter Talke ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar