Skip to main content
Participating Frequently
juil. 28, 2020 6:03 AM UTC
Question

How to call Digital Signature using JavaScript?

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:

  1. Execute JavaScript to show alert 
  2. 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(); " });

 

 

I am getting this error "Error: InvalidArgsError: Invalid arguments." on runtime. 
 
Is there anywhere I can show warning message to user before signing document and Is there a way to call Digital Signature using JavaScript execMenuItem function?

  

Ce sujet a été fermé aux réponses.

5 commentaires

try67
Community Expert
Community Expert
juil. 28, 2020 9:49 AM UTC

Where did you get this menu item name from? It doesn't work even from the Console...

Traduire
ideepakAuteur
Participating Frequently
juil. 28, 2020 10:28 AM UTC

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.

app.execMenuItem("ReadingMode");

 

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.

Traduire
try67
Community Expert
Community Expert
juil. 28, 2020 11:21 AM UTC

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.

Traduire
ls_rbls
Community Expert
Community Expert
juil. 28, 2020 6:29 AM UTC

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?

Traduire
Technical Generalist
ideepakAuteur
Participating Frequently
juil. 28, 2020 10:20 AM UTC

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/

 

Traduire