We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Adding digital signature using syncfusion adds two signatures instead of one

Thread ID:

Created:

Updated:

Platform:

Replies:

141589 Dec 19,2018 01:54 PM UTC Dec 20,2018 11:05 AM UTC WinForms 1
loading
Tags: PDF
Muhammad Ahmad
Asked On December 19, 2018 01:54 PM UTC

I am evaluating syncfusion pdf component for adding digital signature to pdf documents. When I add the signature it adds two signatures in the document instead of one.
I am using the following code for adding signature
PdfLoadedDocument document = new PdfLoadedDocument("DigitalSignaturee3.pdf");
            PdfLoadedPage page = document.Pages[0] as PdfLoadedPage;

            //Creates a signature field.

            PdfSignatureField signatureField = new PdfSignatureField(page, "SignatureField");

            signatureField.Bounds = new RectangleF(0, 0, 100, 100);

            signatureField.Signature = new PdfSignature(document, page, new PdfCertificate(@"C:\Users\Public\Documents\Syncfusion\ASP.NET MVC - EJ2\16.3.0.21\App_Data\PDF\PDF.pfx", "syncfusion"), "SignatureField");

            signatureField.Signature.Reason = "I am author of this document";

            document.Form.Fields.Add(signatureField);

            document.Save();
            //Closes the document
            document.Close(true);

Can you please tell why is it happening so. Image is attached



KarthikeyanC [Syncfusion]
Replied On December 20, 2018 11:05 AM UTC

Hi Muhammad, 
Thank you for your update. 
When we create PdfSignature with the PdfLoadedDocument and PdfLoadedPage as a parameters, then the signature is added in to the PdfLoadedFormFieldCollection of PdfLoadedDocument. So it is not required to adding again in the PdfLoadedFormFieldCollection.  

Kindly use the below code snippet to sign an existing PDF document. 
 
PdfLoadedDocument document = new PdfLoadedDocument("../../data/Input.pdf"); 
PdfLoadedPage page = document.Pages[0] as PdfLoadedPage; 
 
//Creates a signature field. 
 
PdfSignatureField signatureField = new PdfSignatureField(page, "SignatureField"); 
 
signatureField.Bounds = new RectangleF(0, 0, 100, 100); 
 
signatureField.Signature = new PdfSignature(document, page, new PdfCertificate(@"../../data/PDF.pfx", "syncfusion"), "SignatureField"); 
 
signatureField.Signature.Reason = "I am author of this document"; 
 
signatureField.Signature.DocumentPermissions = PdfCertificationFlags.AllowComments | PdfCertificationFlags.AllowFormFill | PdfCertificationFlags.ForbidChanges; 
 
document.Save(); 
 
//Closes the document 
document.Close(true); 
 
 
Refer the below UG to sign an existing PDF document. 
 
Refer the below KB to add multiple signature to the PDF. 
Regards, 
Karthikeyan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;