Since many customers asked us to support PAdES compliant PDF Sigantures in our ZUGFeRD SDK we added support in Version 7.0.12.
While PDF and ISO 32000-1 provide a framework for digitally signing their documents, PAdES specifies precise profiles for use with advanced electronic signature in the meaning of European Union Directive 1999/93/EC. One important benefit from PAdES is that electronically signed documents can remain valid for long periods, even if underlying cryptographic algorithms are broken.
You just need add a reference to our ZUGFeRD library and right away you can digitally sign you PDF Document. This API is also part of the Aloaha PDF Editor PAdES Signature.
As usual we prepared some sample code for you. Please note that most variables are declared “Optional” and do not need to be used. For example if you do not use the signature image the signature will be invisible or with setting TSAURL you can define if the document should be time stamped (LTV).
Please also note that the code below requires a valid license key. You can request your key from info@aloaha.com
Dim LicenseKey As String = “R7TDU7PY7GPMUDX6CQQF4WVTBE”
Dim CertificateSerialNumber As String = “” ‘If you leave this empty Aloaha will ask your for the certificate to be used
Dim InputPDF As String = “d:\invoice.pdf”
Dim OutputPDF As String = “d:\invoice_signed.pdf”
Dim SignReason As String = “I have created this document”
Dim SignLocation As String = “Malta”
Dim SignContact As String = “Stefan”
Dim SignatureHashType As Integer = 2 ‘2 for SHA 256
Dim SignatureImagePath As String = “c:\signature.jpg” ‘Leave this empty to sign invisible
Dim SignatureLeft As Double = 20
Dim SignatureTop As Double = 400
Dim SignatureWidth As Double = 200
Dim SignatureHeight As Double = 100
Dim SignPage As Integer = 1
Dim TSAURL = “http://www.timenotary.com:8081/tsa.aspx” ‘Aloaha Demo Time Stamping Server
Dim result As Boolean = Aloaha_ZUGFeRD.PDF.Sign_PDF( _
InputPDF, _
LicenseKey, _
CertificateSerialNumber, _
SignatureHashType, _
SignReason, _
SignContact, _
SignLocation, _
OutputPDF, _
SignatureImagePath, _
SignatureLeft, _
SignatureTop, _
SignatureWidth, _
SignatureHeight, SignPage, “”, _
True, _
TSAURL)