Highlighted

How to trigger Signature Field event ("Sign with a digital ID" pop up) from javascript?

New Here ,
Jul 31, 2020

Copy link to clipboard

Copied

I have a form which have one Text Field, one Check Box, one Digital Signature and button control.

For Text Field and Check Box control, I am able to validate the value and setfocus if value is not provided on button clicked. 

 

But for Digital Signature, how can I open "Sign with a digital ID" pop up (as snapshot attached here) if document is not signed on button click. I don't what to sign the document using javascript. 

 

Is there any way to open "Sign with a digital ID" pop up directly using javascript if Digital Signature field is available in pdf?     

image.png

 

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

It's much more complicated than that. You would need to study the documentation of the signatureSign method, as well as the SecurityHandler and security objects.

Topics

Acrobat SDK and JavaScript, Create PDFs, Edit and convert PDFs, General troubleshooting, How to, PDF forms, Security digital signatures and esignatures

Views

69

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 trigger Signature Field event ("Sign with a digital ID" pop up) from javascript?

New Here ,
Jul 31, 2020

Copy link to clipboard

Copied

I have a form which have one Text Field, one Check Box, one Digital Signature and button control.

For Text Field and Check Box control, I am able to validate the value and setfocus if value is not provided on button clicked. 

 

But for Digital Signature, how can I open "Sign with a digital ID" pop up (as snapshot attached here) if document is not signed on button click. I don't what to sign the document using javascript. 

 

Is there any way to open "Sign with a digital ID" pop up directly using javascript if Digital Signature field is available in pdf?     

image.png

 

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

It's much more complicated than that. You would need to study the documentation of the signatureSign method, as well as the SecurityHandler and security objects.

Topics

Acrobat SDK and JavaScript, Create PDFs, Edit and convert PDFs, General troubleshooting, How to, PDF forms, Security digital signatures and esignatures

Views

70

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
Most Valuable Participant ,
Jul 31, 2020

Copy link to clipboard

Copied

In order to do that you would need to install a script on the local computer of each user.

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...
New Here ,
Jul 31, 2020

Copy link to clipboard

Copied

Okay.. I have custom meun javascriptr, which is placed inside "C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Javascripts" folder. But I still don't know what to call from javascript to open "Sign with a digital ID" pop up . 

 

Here is the code snap, which is to find signature control in pdf. Based on the control type "Sign with a digital ID" pop up should open using javascript.

 

 

for (var fieldNumber = 0; fieldNumber < this.numFields; fieldNumber++) {
    var controlType = this.getField(this.getNthFieldName(fieldNumber)).type;
    if (controlType === "signature") {
        //Here, I know PDF have signature control and its name
        //My next work is to trigger event to open "Sign with a digital ID" pop up
        this.getField(this.getNthFieldName(fieldNumber)).setFocus();
    }
}

 

 

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...
Most Valuable Participant ,
Aug 01, 2020

Copy link to clipboard

Copied

It's much more complicated than that. You would need to study the documentation of the signatureSign method, as well as the SecurityHandler and security objects.

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...
New Here ,
Aug 03, 2020

Copy link to clipboard

Copied

Thank you, here is the code i add 

 

var  eng  =  security.getHandler("Adobe.PPKLite");                    
this.getField(this.getNthFieldName(fieldNumber)).signatureSign(
eng,   
{},  
1,  
"Sign Embedded File FDF", "Please select a Digital ID to use to sign your embedded file FDF." );

 

 

 

 

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...
Resources
One Stop Solution for Acrobat
Edit a PDF