Is there a way, maybe to use FilteredRenderListener class to insert into the PdfCopy/Stamper such that as content is read from the reader, it is filtered prior to copying to the output pdf???
That would be very cool! -AJ On 2/16/2012 11:22 AM, AJ Weber wrote: > So, now I'm trying to get the Contents of a specific page (of an > existing PDF) so that I can possibly modify it during copy (with > either PdfCopy or PdfStamper hopefully). > > I am missing a step, because I can't get the contents of the actual > /Contents stream. I've tried various scenarios similar to the following: > PdfDictionary dict = reader.getPageN(1); > PdfIndirectReference str = > dict.getAsIndirectObject(PdfName.CONTENTS); > String testcontent = str.toString(); > > But these typically just get the /Contents map (like the properties of > length and filter -- this particular one just returns the dictionary > entry number). Once I have the /Contents entry, how do I get its stream? > > I also tried the simpler reader.getPageContents(), but that gets the > raw bytes, and I'm not sure how to parse/read them from there. Is > there a way to apply the designated filter to "decode" the bytes to > something more understandable, maybe? (I have only seen FlateDecode > used so far for filter.) > > Thanks for any help pointing me in the right direction. > > -AJ > ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php