How to call Digital Signature using JavaScript?
Copy link to clipboard
Copied
My requirement is to show warning message before signing the document without customizing the PDF.
For this I am creating custom menu to execute below action in sequence:
- Execute JavaScript to show alert
- And then pop up digital signature
Below is the Javascript:
var DoMyMenuItem = app.trustedFunction(function(cItemName) {
app.beginPriv();
app.execMenuItem(cItemName);
app.endPriv();
});
function CallMenu() {
try {
app.execMenuItem("FillSignApp");
//DoMyMenuItem("Signatures");
} catch (e) {
app.alert("Error: " + e);
}
}
app.addMenuItem({ cName: "My Action Menu", cParent: "Help", cExec: "CallMenu(); " });
Copy link to clipboard
Copied
Where are you trying to run these scripts from?
Another text field ? or as an javascript action that executes when the signer clicks on the signature field?
Copy link to clipboard
Copied
I have created "Config.js" and kept inside "C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Javascripts"
Refer this link - https://acrobatusers.com/tutorials/add_custom_menu_items/
Copy link to clipboard
Copied
Where did you get this menu item name from? It doesn't work even from the Console...
Copy link to clipboard
Copied
You are correct, this script is not working. I want to know what need to be pass inside app.execMenuItem method to open signature popup.
For example, try replacing below line in above code.
Note: You need to close the Adobe and open again. After then open any pdf document and click on new menu "My Action Menu" under help.
Copy link to clipboard
Copied
There's no menu item from signing a Signature field. It can be done using the signatureSign method of the Field object. Read the documentation carefully before using it.

