hello
I'm trying to write VBA code that will produce a PDF file signed with a digital signature, would love to get help with code written or guidance on how to do this
Regards
hello
I'm trying to write VBA code that will produce a PDF file signed with a digital signature, would love to get help with code written or guidance on how to do this
Regards
Does anyone have a direction what to do ?
I suggest you ask in an Acrobat forum.
Entia non sunt multiplicanda sine necessitate
Found this on the web; searching for the same thing-- it appears osign and oadd are what we're looking for, and it also appears that Javascript is the necessary language to use for adding signatures to pdfs. There is some kind of bug where we can't "pass objects to javascript from vba" and that only strings should be used to communicate between the two languages... and there was also mention that "folder level javascript should be used if trying to auto-sign documents".
However I merely want to add signature fields to docs, not auto-sign them.
I will be testing several scripts like below once I find the time.
Sub PDFSig()
Dim test As Boolean
Set acrobatApplication = CreateObject("AcroExch.App")
Dim gPDDoc As Acrobat.CAcroPDDoc
Set gPDDoc = CreateObject("AcroExch.PDDoc")
gPDDoc.Open Environ$("userprofile") & "\Desktop\TestFile.pdf"
Set jso = gPDDoc.GetJSObject
Set ppklite = jso.security.getHandler("Adobe.PPKLite", True)
test = ppklite.login(InputBox("Please enter your password"), "C:\Documents and Settings\josdmoor\Application Data\Adobe\Acrobat\8.0\Security\JoshuaMoore.pfx")
Set oAdd1 = jso.AddField("Action Form Preparer Signature", "signature", 0, Array(173, 175, 355, 130))
Set oSign1 = jso.GetField("Action Form Preparer Signature")
Set oAdd2 = jso.AddField("Authorized Signer", "signature", 0, Array(173, 130, 355, 86))
Set oSign2 = jso.GetField("Authorized Signer")
oSign1.signatureSign ppklite
ppklite.logout
End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks