- Home
- Forum
- ASP.NET MVC - EJ 2
- How to Enable/Disable re-sign pdf after pdf has been signed with syncfusion
How to Enable/Disable re-sign pdf after pdf has been signed with syncfusion
Hi,
I would like to know if there is an option/property that allows me to re-sign a PDF.
For example if value set to true => so I can re-sign with Adobe reader for example
If value set to false => no one can re-sign after the first signature done with syncfusion
Thanks for your help
SIGN IN To post a reply.
4 Replies
SL
Sowmiya Loganathan
Syncfusion Team
November 18, 2019 01:43 PM UTC
Hi Clement,
Thank you for contacting Syncfusion support.
We can achieve your requirement by using the properties “Certificated” and “DocumentPermissions” of PdfSignature. If we set document permission as ForbidChanges and enable the Certificated property, the first signature fails if we resign the document.
Code Snippet:
|
//Creates a digital signature
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature");
//Sets signature information
signature.Bounds = new RectangleF(bounds);
signature.Certificated = true;
signature.DocumentPermissions = PdfCertificationFlags.ForbidChanges; |
Output document screenshot:
At the same time, if we choose document permission as AllowComments/AllowFormFill and enable the Certified property, the first signature is valid even if we sign another signature to the document.
Code Snippet:
|
//Creates a digital signature
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature");
//Sets signature information
signature.Bounds = new RectangleF(bounds);
signature.Certificated = true;
signature.DocumentPermissions = PdfCertificationFlags.AllowFormFill | PdfCertificationFlags.AllowComments; |
Output document screenshot:
Note: The document permissions only work when we enable the Signature.Certificated property.
Kindly try the above solution in your end and let us know the if it satisfies your requirement.
Regards,
Sowmiya Loganathan
CG
Clement GIL
November 18, 2019 02:50 PM UTC
Ok thanks for you help.
Best Regards.
Clément
TI
Tim
May 25, 2022 09:32 PM UTC
I am trying to do this very thing, and I am generating this exception:
System.ArgumentException HResult=0x80070057 Message=The document may contain at most one author signature! Source=Syncfusion.Pdf.Portable StackTrace: at Syncfusion.Pdf.Security.PdfSignature.set_Certificated(Boolean value).....omitted
IJ
Irfana Jaffer Sadhik
Syncfusion Team
May 26, 2022 01:30 PM UTC
Hi Tim,
We have tried to reproduce the reported issue, but it is working properly on our end. We suspect that the problem may be due to that document specific.
we request you to share the complete code snippet or modified sample, output document, issue screenshot, product version, environmental details (OS, Bit version, culture settings) to replicate the issue on our end. So that it will be helpful for us.
Regards,
Irfana J.
SIGN IN To post a reply.
- 4 Replies
- 4 Participants
-
CG Clement GIL
- Nov 15, 2019 02:38 PM UTC
- May 26, 2022 01:30 PM UTC