Hi, Thanks for the script & reference to PDF standard. Watermarks are indeed annotations - see page 410 at the bottom: http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf
The code I got to so far is, but the use of stamper should be avoided: import com.itextpdf.text.DocumentException; import com.itextpdf.text.pdf.*; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.Map; import java.util.Set; public class hasWatermark { public static void main(String[] args) throws FileNotFoundException, DocumentException, IOException { PdfReader reader = new PdfReader("D:\\Annotations.pdf"); if (isWatermarked(reader)) System.out.println("is marked"); else System.out.println("is not marked"); reader.close(); } public static boolean isWatermarked(PdfReader reader) throws DocumentException, IOException{ PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("d:\\text.pdf")); 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; System.out.println("Layer name: " + key); //PdfLayer layer = layers.get(key); // do stuff with layer... } } stamper.close(); return wm; } } ************************************************************************************ This footnote confirms that this email message has been scanned by PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses. ************************************************************************************ ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/