In this tutorial we will see how we add digital signature to PDF page(s).
We have used followings object & method to add a digital signature.
1) What is JSObject.
The mechanism for accessing Acrobat JavaScript from an external client (application other than Acrobat) such as Visual Basic is called JSObject.
This JSObject is done from OLE (IAC).
JSObject only allows access to Acrobat JavaScript Doc objects.
Due to restrictions, not all Acrobat JavaScript features can be used.
2) Security handler object and ppklite
We have to use SecurityHandler object is used to access security handler features such as signatures, encryption, and directories. Its properties and methods vary from security handler to security handler. This section describes all the properties and methods of the security object. Whether or not these properties and methods are implemented depends on the securityHandler object.
Few securityhandlers available in system are :-
Adobe.APS
Adobe.PPKLite
Adobe.PPKMS
Adobe.AAB
To get the securityHandler object, use the [security.getHandler] method.
The JavaScript interface for signing with Adobe.PPKLite was introduced in Acrobat 5.0. Other JavaScript interfaces were introduced in Acrobat 6.0. Prior to 6.0, versions of Acrobat did not allow third-party security handlers to be used in JavaScript.
3) Need to add signature field and define coordinates.
3.a) Coordinates specifying position and size of the signature field's bounding rectangle, with origin (0,0) at bottom left of page.
3.b) Specify Coordinates in following order.
order: top-left x, top-left y, bottom-right x and bottom-right y.
4) Need to Login using PFX file and Mention some time out
PFX - It is usually password protected and can be stored on your computer in PKCS #12 file format (Personal Information Exchange File, PFX). When you buy a new digital signature, you get. ... pvk file that contains your private keys. Use Microsoft command-line tool Pvk2Pfx to convert them into a PFX file.
Sets the number of seconds after signing that the password expires. This method is only supported by the Adobe.PPKLite security handler. For this handler, the default timeout value for new users is 0 (password is always required).
5) Pass Oinfo Array
oInfo is SignatureInfo object that sets the writable property of the signature.
6) Sign the Signature field with the PPKLite signature handler.
7) Logout
#practicalit #vbapdfautomation #adddigitalsignatureusingvba #adddigitalsignature
Негізгі бет VBA PDF Automation - Add digital signature to PDF
No video
Пікірлер: 31