That's quite easy. Look at the source of PdfReader.removeUnsusedObjects() and get what you need to reach all the pdf objects. If the PdfObject is a dictionary or a prstream use remove(PdfName.METADATA). Finally to clean up what was removed call PdfReader.removeUnsusedObjects().
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Greg Sabatino > Sent: Tuesday, April 12, 2005 4:27 PM > To: [email protected] > Subject: [iText-questions] Need to strip all XMP metadata > when using PdfCopy > > Hello, I am using PdfCopy to copy existing pdf's but need a > way to positively remove any XMP metadata. As a first attempt > I am using "reader.getCatalog().remove(PdfName.METADATA)" > prior to creating a new Document using the reader. This seems > to work just fine but I see in the PDF spec that XMP metadata > can be contained in any components that are represented as a > stream or dictionary. Does anyone know if there as a way to > find and remove all those metadata streams if they exist > anywhere in the document? Thanks, Greg > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
