Hi,

I am trying to add watermark image in a digitally signed PDF using
itextsharp but after adding image Adobe Acrobat says that my signature is
invalid although I am adding in append mode. I have also checked the
internal PDF structure after adding image and the signature content is
intact (have no temper). can someone please guide me what is wrong in my
code? 
you can also get signed and output pdf files from  here
<http://itext-general.2136553.n4.nabble.com/file/n4657457/files.rar>  .

below is my code snippet to add Image.

using (Stream inputPdfStream = new FileStream("signed.pdf", FileMode.Open,
FileAccess.Read, FileShare.Read))
using (Stream inputImageStream = new FileStream("watermark.jpg",
FileMode.Open, FileAccess.Read, FileShare.Read))
using (Stream outputPdfStream = new FileStream("result.pdf",
FileMode.Create, FileAccess.Write, FileShare.None))
{
      PdfReader reader = new PdfReader(inputPdfStream);
      PdfStamper stamper = new PdfStamper(reader, outputPdfStream, '\0',
true);
      PdfContentByte pdfContentByte = stamper.GetOverContent(1);
      Image image = Image.GetInstance(inputImageStream);
      image.SetAbsolutePosition(0, 0);
      pdfContentByte.AddImage(image);
      stamper.Close();
      reader.Close();
}

Regards,
Faisal



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Digital-Signature-Corrupted-after-adding-watermark-image-tp4657457.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-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