problem to signed pdf

Jose
Updated on Jan 08, 2018 06:05 AM
Hi

Happy new year

I am using this code on VB.net

this opens the pdf and creates a signature correctly
but when I read the pdf, if I go to the signature field, it indicates that it is a valid signature and everything is correct if I click with the mouse on the signature, it also indicates a valid signature
but the signature box is a white box and I do not see the content of the validated signature.

What is missing me there?

If I do it with any other tool if I see the vise and the validated signature
com pdf_sign by example ItextSharp if I see the signature box

Thank you


'Loads the PDF document with signature field.
Dim loadedDocument As New PdfLoadedDocument("Input.pdf")
    'Gets the page.
Dim l As Integer = loadedDocument.Pages.Count - 1
Dim page As PdfLoadedPage = TryCast(loadedDocument.Pages(l), PdfLoadedPage)

'Creates a signature field.

Dim signatureField As New PdfSignatureField(page, "SignatureField")

signatureField.Bounds = New RectangleF(0, page.Graphics.ClientSize.Height - 260, 300, 100)

signatureField.Visible = True


'Adds certificate to the signature field.
signatureField.Signature = New PdfSignature With {
.Certificate = New PdfCertificate("F:\firmadigitales\rep_slc_hasta122018.pfx", "1234"),
.Reason = "Documento expedido por XXXXX"
}
'Adds the field.

loadedDocument.Form.Fields.Add(signatureField)

'Saves the certified PDF document.
     
loadedDocument.Save("Output.pdf") loadedDocument.Close(True)

Attachment: Sin_título_8e01f15e.rar

2 Replies

SL Sowmiya Loganathan Syncfusion Team January 9, 2018 12:25 PM UTC

 Hi Jose, 

We have checked the provided screenshot and code snippet, it contains only bounds of the signature, so it appears to be signature blank. it is our default behavior. To achieve your requirement, you can use the below code snippet:  

Dim signature As New PdfSignature(loadedDocument, page, pdfCert, "Signature") 
//Creates the appearance of the signature 
signature.Appearance.Normal.Graphics.DrawString("Digitally signed by Syncfusion", font, PdfBrushes.Black, New PointF(0, 0)) 
 

We have create the simple sample to add the content to signature box. Please find the sample from below : 

Please find the screenshot for the output document from below : 
 

Please try this in your end and let us know if it solves your issue. 

Regards, 
Sowmiya L 



JO Jose January 9, 2018 01:41 PM UTC

Hi
Thanks
Best Regards


Loader.
Up arrow icon