Hello, short note to inform the list that I was able to write code that enables you to remove the content of OCG-layers from a PDF. This code needs further testing and it will be part of iText-tk, an addon for iText that is available for iText Software customers (upon demand).
On 21/06/2011 18:15, Leonard Rosenthol wrote: > Yeah - this is one of those things you simply can NOT do with a pure > stream-based solution. You need a higher level abstraction - aka a "display > list". > > Leonard > > -----Original Message----- > From: 1T3XT BVBA [mailto:i...@1t3xt.info] > Sent: Tuesday, June 21, 2011 11:53 AM > To: Post all your questions about iText here > Subject: Re: [iText-questions] iText: how to remove the layer (watermark)? > > On 21/06/2011 17:36, olexiy wrote: >> Could you just give me an example code? > No, I've spent a full day coding to parse the content stream and to remove > specific OCG layers. > It works and it doesn't work. > It works in the sense that the correct PDF syntax is removed. > It doesn't work in the sense that for some PDFs the state operators are no > longer balanced if you remove stuff like this /OC /SomeLayer BDC q some q > syntax Q EMC As you can see, there are two "save state" operators in this > (pseudo) PDF snippet, and only one "restore state" operator. > I've written code to deal with this problem, but I can't just add 'q' or 'Q' > at arbitrary places: in some cases, this results in a graphics state that is > changed in a way that is not desired. ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ 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