Display Binary Image on digital signature acrofield in PDF

Hello,

I have a signature pad in my app. I save signature pad value as byte array image in database under the name _rI.SignatureImage. Now I want to display same image on Digital Signature control in Pdf. Please have a look at the following code:

          if (_rI.SignatureImage != null)
            {
                PdfLoadedSignatureField loadedSignatureField = loadedForm.Fields[1] as PdfLoadedSignatureField;
                ???????  = _rI.SignatureImage;
            }

Thank you,
Madhu

1 Reply 1 reply marked as answer

SL Sowmiya Loganathan Syncfusion Team July 2, 2020 10:25 AM UTC

Hi Madhu,    
   
Thank you for contacting Syncfusion support.    
   
We have analyzed your requirement “Insert image in the signature field of PDF document” and we can able to achieve this by adding an image to signature field appearance. Please refer the below code snippet for more details,    
   
//Gets the first signature field of the PDF document   
PdfLoadedSignatureField field = loadedDocument.Form.Fields[0] asPdfLoadedSignatureField;   
   
//Creates a certificate   
PdfCertificate certificate = new PdfCertificate(certifcateStream, "syncfusion");   
field.Signature = new PdfSignature(loadedDocument, page, certificate, "Signature", field);   
   
PdfBitmap image = new PdfBitmap(imageStream);   
field.Signature.Appearance.Normal.Graphics.DrawImage(image, new PointF(0,0));   
   
  
Please try the above solution in your end and let us know if you need any further assistance with this.   
   
Regards, 
Sowmiya Loganathan 


Marked as answer
Loader.
Up arrow icon