'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)|
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)) |