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