clebergyyn
New member
- Local time
- Yesterday, 18:17
- Joined
- Feb 16, 2017
- Messages
- 25
There's this other code here too, below. Also made for Excel-Vba.
Code:
Sub DigitalSignedPDFCode()
Dim SignedPDF, FileCount, PFX_pass, strSignFName, inputpdf, epass, outputpdf
Dim pdfPDDoc As New AcroPDDoc, oJS As Object, oSign As Object, oPpklite As Object
Dim oSignInfo As Object
Dim ResultLogin As Boolean
Dim ResultSign As Boolean
Dim arr() As String
Set pdfPDDoc = CreateObject("AcroExch.PDDoc")
Set oJS = pdfPDDoc.GetJSObject
Set oPpklite = oJS.security.getHandler("Adobe.PPKLite", True)
strSignFName = "PFX CERTIICATE PATH"
PFX_pass = "PFX PASSWORD"
inputpdf = "PDF FILE FOR SIGN"
outputpdf = "PDF FILE AFTER SIGNED"
'Page 1
Set oFields = oJS.AddField("SignatureField", "signature", 0, Array(80, 220, 255, 250))
Set oSign = oJS.GetField("SignatureField")
ResultLogin = oPpklite.login(PFX_pass, strSignFName)
oPpklite.setPasswordTimeout PFX_pass, 60
arr = Split("", ",")
ResultSign = oSign.signatureSign(oPpklite, arr, outputpdf)
oPpklite.logout
pdfPDDoc.Close
Set oJS = Nothing
Set oSign = Nothing
Set oPpklite = Nothing
Set pdfPDDoc = Nothing
End Sub