Michael,
Now I am trying to add image using annotation, which adobe allow but
signature is still getting invalid. its seams a bug in ItextSharp. please
check my code if I am doing wrong
PdfReader reader = new PdfReader("signed.pdf");
using (Stream strm = new MemoryStream())
{
PdfStamper stamper = new PdfStamper(reader, strm, '\0', true);
Image stampImg = Image.GetInstance("watermark.jpg");
int pageNo = 1;
Rectangle pdfRect = new Rectangle(0, 400, 200, 750);
iTextSharp.text.pdf.PdfAnnotation pdfStamp =
iTextSharp.text.pdf.PdfAnnotation.CreateStamp(stamper.Writer,
pdfRect, null, Guid.NewGuid().ToString());
stampImg.SetAbsolutePosition(pdfRect.Left, pdfRect.Bottom);
PdfAppearance app =
stamper.GetOverContent(pageNo).CreateAppearance(stampImg.Width,
stampImg.Height);
app.AddImage(stampImg);
pdfStamp.SetAppearance(PdfName.N, app);
stamper.AddAnnotation(pdfStamp,pageNo);
stamper.Close();
File.WriteAllBytes("output.pdf", ((MemoryStream)strm).ToArray());
}
reader.Close();
On Tue, Jan 29, 2013 at 2:34 PM, mkl <m...@wir-sind-cool.org> wrote:
> faisal,
>
> faisal wrote
> > But Adobe Acrobat allow to add watermark/annotation in this signed pdf
> and
> > after adding signature remains valid. can you guide me that how I can add
> > an Image in a signed pdf, either using watermark technique or annotation
> > and signature remain valid like Adobe Acrobat.
>
> Depending on the allowed changes selected by the signer, Annotation
> creation
> is allowed. Watermarks (by adding of images to the content stream like you
> tried) are never allowed. Maybe, though, Adobe Acrobat uses annotations in
> some creative way to create watermarks.
>
> You might want to use Adobe Acrobat to create such a watermark annotation,
> analyze the PDF generated, and emulate that process in iText.
>
> Subsection "Adding annotations to an existing PDF" in section 7.3.1 of
> iText
> in Action, 2nd edition, and the sample TimeTableAnnotations1.java show how
> to add annotations to existing PDFs.
>
> Regards, Michael
>
>
>
> --
> View this message in context:
> http://itext-general.2136553.n4.nabble.com/Digital-Signature-Corrupted-after-adding-watermark-image-tp4657457p4657462.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
>
--
*Regards,*
*Faisal*
------------------------------------------------------------------------------
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_jan
_______________________________________________
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