Faisal, faisal wrote > Adobe allow to add Image base annotation and after adding signature remain > valid. Following are the documents > original signed document > <http://itext-general.2136553.n4.nabble.com/file/n4657657/signed.pdf> > and > image base annotation document > <http://itext-general.2136553.n4.nabble.com/file/n4657657/signed-image-stamp.pdf> > > added using Adobe Acrobat 9.
Ok, so I tried to create something like that using iText with this result: signed-stamped.pdf <http://itext-general.2136553.n4.nabble.com/file/n4657659/signed-stamped.pdf> which here does not seem to invalidate the signature. The (Java) code is very much like yours with one essential difference: final PdfReader signedReader = new PdfReader("signed.pdf"); final PdfStamper watermarkStamper = new PdfStamper(signedReader, new FileOutputStream("signed-stamped.pdf"), (char)0, true); Image image = Image.getInstance("watermark.jpg"); image.setAbsolutePosition(0, 0); PdfTemplate template = PdfTemplate.createTemplate(watermarkStamper.getWriter(), image.getWidth(), image.getHeight()); template.addImage(image); Rectangle rect = new Rectangle(200, 470, 200 + image.getWidth(), 470 + image.getHeight()); PdfAnnotation annotation = PdfAnnotation.createStamp(watermarkStamper.getWriter(), rect, null, "AnnotationOnly"); annotation.setAppearance(PdfName.N, template); watermarkStamper.addAnnotation(annotation, 1); watermarkStamper.close(); The essential difference is that you used stamper.GetOverContent(pageNo).CreateAppearance(stampImg.Width, stampImg.Height); to create the appearance template, while this code here uses PdfTemplate.createTemplate(watermarkStamper.getWriter(), image.getWidth(), image.getHeight()); Your call GetOverContent prepares the page for the addition of additional page content which already is something that is not allowed in signed documents. The createTemplate call, on the other hand, does not change the page content and, thus, is secure. Regards, Michael -- View this message in context: http://itext-general.2136553.n4.nabble.com/Digital-Signature-Corrupted-after-adding-watermark-image-tp4657457p4657659.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ 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