//Creates a digital signature
PdfSignature signature = new PdfSignature(loadedDocument, page, pdfCert, "Signature");
//Sets signature information
signature.Bounds = new RectangleF(0, 100, 200, 100);
signature.ContactInfo = "johndoe@owned.us";
signature.LocationInfo = "Honolulu, Hawaii";
signature.Reason = "I am author of this document.";
signature.EnableValidationAppearance = true;
//Create appearance for the digital signature
signature.Appearance.Normal.Graphics.DrawRectangle(PdfBrushes.White, new RectangleF(0, 0, 200, 100));
|
Hi,
It looks like newer version of the library has corrupted the existing feature. I am trying the code suppose to be working but it makes the verification icon behind the Appearance Graphics. Please try following code.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("testpdf.pdf");
PdfCertificate pdfCertificate = new PdfCertificate("testlicense.pfx", "password");
PdfSignature signature = new PdfSignature(loadedDocument, loadedDocument.Pages[0], pdfCertificate, "Signature");
signature.Bounds = new RectangleF(0, 100, 200, 100);
signature.ContactInfo = "johndoe@owned.us";
signature.LocationInfo = "Honolulu, Hawaii";
signature.Reason = "I am author of this document.";
signature.EnableValidationAppearance = true;
signature.Appearance.Normal.Graphics.DrawRectangle(PdfBrushes.White, new RectangleF(0, 0, 200, 100));
loadedDocument.Save();
Process.Start("testpdf.pdf");
Hi Smithangshu,
Thank you for the update!
We suggest that you enable the EnableValidationAppearance feature after you've finished making changes to how your signature looks. We recommended to update your highlighted changes to overcome the issue.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("testpdf.pdf");
PdfCertificate pdfCertificate = new PdfCertificate("testlicence.pfx", "password"); PdfSignature signature = new PdfSignature(loadedDocument, loadedDocument.Pages[0], pdfCertificate, "Signature");
signature.Bounds = new RectangleF(0, 100, 200, 100); signature.ContactInfo = "johndoe@owned.us"; signature.LocationInfo = "Honolulu, Hawaii"; signature.Reason = "I am author of this document.";
signature.Appearance.Normal.Graphics.DrawRectangle(PdfBrushes.White, new RectangleF(0, 0, 200, 100));
signature.EnableValidationAppearance = true;
loadedDocument.Save("testpdf1.pdf"); Process.Start("testpdf1.pdf"); |
Regards,
Jeyalakshmi T