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. Image for the cookie policy date
close icon

How to add signature field

Hi,

We are evaluating Syncfusion Pdf for our Digital Pdf Signature project,

The scenario is: 

I want to have 5 signature boxes, so each signer can sign on each signature box (either they draw directly or use saved signature image),
I try to add 5 signature fields into a pdf using codes below and it runs successfully but it only shows 1 signature box (see enclosed pdf)

What I missed in my C# codes? or Did I have misunderstanding with this?

And how to add a text (ie. for signer name) below each signature box?


 for (int _i = 0; _i < 5; _i++)
                        {
                            signatureField.Bounds = new Syncfusion.Drawing.RectangleF(72+(_i*100), (float)(_hloadedLastPage * 0.7), 90, 30);
                            signatureField.ToolTip = "Signature";
                            signatureField.Required = true;
                            signatureField.BorderStyle = PdfBorderStyle.Solid;
                            //Add the form field to the document.
                            loadedDocument.Form.Fields.Add(signatureField);
                            // End Signature Field
                        }

Attachment: file_8401058a.zip

1 Reply

SL Sowmiya Loganathan Syncfusion Team July 29, 2019 09:57 AM UTC

Hi Winanjaya, 
 
Greetings from Syncfusion. 
 
We have checked the issue which you have mentioned with the provided output document and code snippet. We have modified the code snippet to preserve 5 signature fields in PDF document and add text in below of each signature field . Please find the below code snippet for more details, 
 
for (int _i = 0; _i < 5; _i++) 
{ 
     //Create PDF Signature field 
     PdfSignatureField signatureField = new PdfSignatureField(page, "Signature"); 
     //Set bounds 
     signatureField.Bounds = new Syncfusion.Drawing.RectangleF(72 + (_i * 100), (float)(100 * 0.7), 90, 30); 
     signatureField.ToolTip = "Signature"; 
     signatureField.Required = true; 
     signatureField.BorderStyle = PdfBorderStyle.Solid; 
     //Add the form field to the document. 
     document.Form.Fields.Add(signatureField); 
     // End Signature Field 
 
     //Draw text in below of each signature box  
     page.Graphics.DrawString("(John)", new PdfStandardFont(PdfFontFamily.Helvetica, 10), PdfBrushes.Black, new PointF(72 + (_i * 100)+25, (float)(100 * 0.7)+40)); 
} 
 
Please find the sample for the same from below, 
 
Kindly try the above solution in your end and let us know if it satisfies your requirement.  
 
Regards, 
Sowmiya L 


Loader.
Live Chat Icon For mobile
Up arrow icon