Thank you for your reply.
I am sure that the layer is only created  through the procedure which I
shown before. Will he be OCG I do not know (I do not know what OCG ist).
Until now i have not worked with iText , and after i solve this problem
unlikely to do it in the next  time.
Here's how I check for wotermark layer (and it seem to work):

private boolean hasWatermark(File pdfFile) throws Exception {
                File tempStemper = null;
                try {
                        PdfReader reader = new PdfReader(pdfFile.getPath());
                        tempStemper = File.createTempFile(".pdf", 
"hasWatermarkTemp");
                        PdfStamper stamper = new PdfStamper(reader, new 
FileOutputStream(
                                        tempStemper));
                        Map<String, PdfLayer> layers = 
stamper.getPdfLayers();
                        boolean wm = false;
                        if (!layers.isEmpty()) {
                                Set<String> keys = layers.keySet();
                                for (String key : keys) {
                                        if 
(key.toString().equalsIgnoreCase("watermark"))
                                                wm = true;
                                }
                        }
                        stamper.close();
                        return wm;
                } catch (Exception e) {
                        throw e;
                } finally {
                        if ((tempStemper != null) && (tempStemper.exists()))
                                tempStemper.delete();
                }

        }


I start to read "iText in Action". Could you tell exactly where in the Book
can i find example to a technique from your replay or give me a small code
fragment.

P.S.: Sorry for my English. 

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/iText-how-to-remove-the-layer-watermark-tp3576811p3576956.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
iText-questions mailing list
[email protected]
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