To do it in PdfWriter:

PdfStream xmp = new PdfStream("xmp text".getBytes("UTF-8"));
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);

Use the iText version at itextpdf.sf.net.

Best Regards,
Paulo Soares

> -----Original Message-----
> From: Roger Misteli [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, May 06, 2004 10:08 AM
> To: Paulo Soares
> Subject: XMP & iText
> 
> Hi Paolo
> 
> I'm sorry if I disturb you here, but I'm doing a very 
> important project
> for the company I work for and we use iText for producing 
> PDF's. However,
> we want to write XMP metadata with iText at the time we create the
> document. Now, iText only seems to support writing metadata AFTER the
> whole document has been written (using a PdfReader). I asked in the
> mailing list, but I didn't get an asnswer, but when reading another
> mailing list that you posted on and wrote about your own experimental
> version, it seems to me, as if you have done just that.
> The question is, if I understood this correctly and you can 
> do this, can
> you give me a pointer as to how I can do that with your version?
> 
> Thanks very much in advance and sorry again, fi I disturb you 
> privately,
> but it is very important for our company
> 
> Kind regards,
> Roger Misteli
> 
> 
> /*
>  * Roger Misteli - ABACUS Research AG
>  * email: [EMAIL PROTECTED] (PGP key available)
>  * "If you think the problem is bad now, just wait until 
> we've solved it."
>  */
> 
> 
> 


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to