Well, that's just it. Seems that if the metadata in the catalog is always to be XMP XML, then the solution is pretty much ready-made based on what I have done.
The XMP is, as far as I can tell, RDF XML embedded in <?xpacket> tags. These are the only part that are peculiar to XMP (this may be an oversimplified approach as I have not absorbed the entire XMP spec, but it's a start). The problem is that getMetadata() already returns the whole stream, including these external tags. This suggests that setMetadata() should accept similar data, and leads me to the idea that we can set up the <?xpacket> tags in another class. Setting these for output is easy. If we provide comparable input functionality, however, it would probably be most sensible to use an XML parser to strip off the <?xpacket> tags. Using the Jena-RDF API I didn't have to worry about this because the package is equipped to find embedded RDF and discard the containing XML. The simplest thing, then, might just be to include a static method String xmpWrap(String rdf) or some such on PdfStamper and recommend Jena for processing and morphing the RDF. The most versatile approach, on the other hand, would be to include a facility for retrieving the embedded RDF from the metadata. In this case, again, we would be best off using an XML parser, and that brings up the question of whether this might belong in iTextXML.jar, and/or in a package com.lowagie.text.pdf.xmp? If we can decide the best approach, I can implement. -Matt --- Paulo Soares <[EMAIL PROTECTED]> wrote: > I know nothing about XMP and I don't even know > what's that for. If someone > shows up with a ready made solution I'll integrate > it into iText otherwise I > won't do any development on it. Sorry. > > Best Regards, > Paulo Soares > > ----- Original Message ----- > From: "Matt Benson" <[EMAIL PROTECTED]> > To: "Paulo Soares" <[EMAIL PROTECTED]>; > <[EMAIL PROTECTED]> > Sent: Wednesday, March 26, 2003 17:47 > Subject: RE: [iText-questions] New release > itext-paulo-113 > > > > I could live with that. I just figure I probably > > won't be the last person to want to do this. > Would > > you want to provide any support for structuring > the > > XMP? There are a lot of things that seem to be > fairly > > constant with XMP. I have attached the > "constants" I > > used. I ignored the "bytes" attribute of the > ?xpacket > > tag, but it should be easy to set if this were put > > into a nice central location within iText. > > > > -Matt > > > > --- Paulo Soares <[EMAIL PROTECTED]> wrote: > > > Well, I suppose that the method in PdfStamper > would > > > make sense. > > > > > > Best Regards, > > > Paulo Soares > > > > > > > -----Original Message----- > > > > From: Matt Benson [SMTP:[EMAIL PROTECTED] > > > > Sent: Wednesday, March 26, 2003 17:22 > > > > To: Paulo Soares; > > > '[EMAIL PROTECTED]' > > > > Subject: RE: [iText-questions] New release > > > itext-paulo-113 > > > > > > > > I know--is the implication that this method's > > > > existence might be misleading to the new user > and > > > > generate a lot of e-mails to the list? ;) > > > > > > > > -Matt > > > > > > > > --- Paulo Soares <[EMAIL PROTECTED]> wrote: > > > > > setMetadata would need something like > PdfStamper > > > to > > > > > write new content. > > > > > > > > > > Best Regards, > > > > > Paulo Soares > > > > > > > > > > > -----Original Message----- > > > > > > From: Matt Benson > [SMTP:[EMAIL PROTECTED] > > > > > > Sent: Tuesday, March 25, 2003 15:43 > > > > > > To: Paulo Soares; > > > > > '[EMAIL PROTECTED]' > > > > > > Subject: Re: [iText-questions] New release > > > > > itext-paulo-113 > > > > > > > > > > > > Nice, but out of curiosity, why did you > decide > > > not > > > > > to > > > > > > add a corresponding setMetadata method? > > > > > > > > > > > > -Matt > > > > > > > > > > > > --- Paulo Soares <[EMAIL PROTECTED]> > wrote: > > > > > > > Changes in itext-paulo-113 (2003-03-25) > > > > > > > > > > > > > > - added a new arabic shaper with > farsi > > > > > support. > > > > > > > > > > > > > > - FdfWriter will also output the > fields > > > from > > > > > a > > > > > > > PdfReader and AcroFields. > > > > > > > > > > > > > > - fixed PdfAcroForm for a problem > when > > > > > creating > > > > > > > text fields. The /DA key > > > > > > > was being generated incorrectly. > > > > > > > > > > > > > > - added a file attachment > annotation. > > > > > > > > > > > > > > - the subtype for the ink annotation > was > > > > > wrong. > > > > > > > > > > > > > > - modified toPdf() method to write > > > directly > > > > > to > > > > > > > the stream. > > > > > > > OutputStreamCounter > > > > > > > was created to aid. > > > > > > > > > > > > > > - added ModDate to the info > dictionary. > > > > > > > > > > > > > > - added methods in PdfPTable to set > > > absolute > > > > > > > column widths. > > > > > > > > > > > > > > - added PdfReader.getMetadata() to > get > > > the > > > > > XML > > > > > > > metadata. > > > > > > > > > > > > > > - speed improvement in PdfReader. > > > > > > > > > > > > > > - fixed a bug in PdfStamperImp when > > > stamping > > > > > or > > > > > > > flattening and the > > > > > > > original page > > > > > > > content didn't end in an > whitespace. > > > > > > > > > > > > > > - added the ability to manipulate > > > directly > > > > > the > > > > > > > catalog and the info > > > > > > > dictionary > > > > > > > in PdfWriter. Other methods where > made > > > > > public > > > > > > > for ease of access to > > > > > > > low level > > > > > > > features. > > > > > > > > > > > > > > > > > > > > > > > > > > > > All this at: > > > > > > > > > > > > > > http://www.geocities.com/itextpdf > > > > > > > Mirror at http://itext.execuchoice.net > > > > > > > > > > > > > > Best Regards, > > > > > > > Paulo Soares > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > > > This SF.net email is sponsored by: > > > > > > > The Definitive IT and Networking Event. > Be > > > > > There! > > > > > > > NetWorld+Interop Las Vegas 2003 -- > Register > > > > > today! > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en > > > > > > > > > > _______________________________________________ > > > > > > > iText-questions mailing list > > > > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/itext-questions > > > > > > > > > > > > > > > > > > > > > > __________________________________________________ > === message truncated === __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com ------------------------------------------------------- This SF.net email is sponsored by: The Definitive IT and Networking Event. Be There! NetWorld+Interop Las Vegas 2003 -- Register today! http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
