Not able to get the suignature box

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

The scenario is:

I have a pdf file and I want to list out all the signature boxes added in the PDF file so that I can add any image stream in the signature box(if possible).
The problem is I am able to get all the control in the pdf except the signature.

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


PdfLoadedDocument loadedDocument = new PdfLoadedDocument(System.Convert.FromBase64String(Base64String));

PdfLoadedSignatureField signatureField = loadedDocument.Form.Fields["Signature"] as PdfLoadedSignatureField;

also could you please share the code to add an image in the signature box from code?


1 Reply 1 reply marked as answer

SL Sowmiya Loganathan Syncfusion Team February 15, 2021 12:31 PM UTC

Hi Ashish,   
  
Thank you for contacting Syncfusion support.   
  
We have analyzed your requirement and you can able to get the signature fields in an existing PDF document by using the below code snippet,   
  
//Get existing form   
PdfLoadedForm loadedForm = loadedDocument.Form;  
  
for (int i=0;i<loadedForm.Fields.Count;i++)  
{  
    //Check whether the field is signature field or not  
    if(loadedForm.Fields[i] is PdfLoadedSignatureField)  
    {  
        //Get the signature field   
        PdfLoadedSignatureField signatureField = loadedDocument.Form.Fields[i] asPdfLoadedSignatureField;  
            }        
}  
  
We have created the sample to achieve your requirement of adding image to the signature box in the PDF document and please find the download link from below,   
  
  
Please try the above sample in your end and let us know the result.   
  
Regards,  
Sowmiya Loganathan  
 


Marked as answer
Loader.
Up arrow icon