On 14/02/2012 17:23, AJ Weber wrote:
> Right.  How do I determine if the text in the /Contents stream is the
> intended contents of the page, or whether someone added it
> after-the-fact?  Ugh.  Users...
It depends on how the text was added.

For instance: if they used PdfStamper, there will be different content 
streams in an array.
Maybe the content you want to remove is in one array, which you could 
remove.

Or maybe it was added as an XObject.
In that case, blanking out the content of that XObject would solve your 
problem.

Or maybe it's really inside the main content stream.
In that case, you need to write a PDF syntax parser (I've written 
several in the past) using PRTokeniser.
Let the parser copy all the PDF syntax except for the Text Operators 
(and its operands) that draw the text you want to remove.

Have fun!

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
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

Reply via email to