Highlighted

How to call Digital Signature using JavaScript?

New Here ,
Jul 27, 2020

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:

  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?

  

TOPICS
Acrobat SDK and JavaScript, General troubleshooting, How to, Security digital signatures and esignatures, Standards and accessibility

Views

260

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to call Digital Signature using JavaScript?

New Here ,
Jul 27, 2020

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:

  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?

  

TOPICS
Acrobat SDK and JavaScript, General troubleshooting, How to, Security digital signatures and esignatures, Standards and accessibility

Views

261

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 27, 2020 0
Adobe Community Professional ,
Jul 27, 2020

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2020 0
New Here ,
Jul 28, 2020

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/

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
Most Valuable Participant ,
Jul 28, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
New Here ,
Jul 28, 2020

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.

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
try67 LATEST
Most Valuable Participant ,
Jul 28, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0