• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Notallowed signaturesign javascript DC Reader

Community Beginner ,
Jun 17, 2021 Jun 17, 2021

Copy link to clipboard

Copied

Hi,

I have been using a custom javascript I wrote for years on Acrobat Pro 6. It also works on Acrobat Standard X but I have not been able to get it work on Acrobat Reader DC.

 

The javascript finds a location for a signature field, creates the field, then signs it with a Digital Certificate Signature.

 

everytime the code gets to

field.signatureSign

The console gives  a Notallowed security error. I already have a trusted function etc (this all worked in Acrobat X) but cannot get it to work in DC Reader.

After it errors, I can click on the signature field with my mouse and Reader DC pops up up the sign dialog and I can then sign the file, so reader is working with the digital ID, is able to sign the documents etc, but not from javascript?

 

Can anyone tell me whats different, is this a function not available in Reader?

Can anyone confirm they can get Adobe Reader DC to  field.signatureSign in javascript correctly

 

 

Code section below, it is "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\Javascripts\DigSigJC.js"

Note: Calling it config.js makes no difference.

 

// Adds signature to document and saves
function sign_document(operation) 
{
var field = this.addField({cName:'Signature', cFieldType:'signature', nPageNum:0, oCoords:[0,0,0,0]}); // Creates Signature Field
field.rect=[320,75,375,60];
    trusted_signature(field); // Add signature to field
    app.execMenuItem('Save',this); // Save document
}
// Trusted operation to perform signing
var trusted_signature =app.trustedFunction(function(field) 
{
app.beginPriv();
var sig = {appearance:'Approved',reason:'Approved for Manufacture',mdp:'allowNone'};
var sec = security.getHandler('Adobe.PPKLite', false);
         // List all the available signature handlers
//for (var i=0; i<security.handlers.length; i++)
// console.println(security.handlers[i]);
         //sec.login({bUI:true}); Makes no difference
//console.println("isLoggedIn="+sec.isLoggedIn);
field.signatureSign({oSig: sec, oInfo: sig, bUI: false});
app.endPriv();
});

 

I also have the following javascript settings, but have tried them all to no avail.

default1sqzixayydm3_0-1623973227111.png

 

Any help greatly appreciated.

 

John.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.5K

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
community guidelines
Community Expert ,
Nov 23, 2021 Nov 23, 2021

Copy link to clipboard

Copied

There are two issues here that cause confusion, I think.

 

One is that although Reader can now do many things it couldn't do before (save filled in forms, for example, or sign documents), the JS methods that allow such actions have not been updated accordingly so they still require special rights applied to the file, even though you can do the same actions manually, without those rights.

 

The second one is that the description of which rights are needed for certain JS methods to work in the API Reference is very vague. The "Form rights" mentioned there, for example, is not the one you apply in Acrobat, but one that requires using LiveCycle Reader Rights Management, a very expensive server product Adobe sells. Same with "File attachment rights", and probably also "Digital signature rights". This is not mentioned at all in the documentation, though, so many people believe that just applying the Extended Reader Rights in Acrobat is sufficient, when in fact it's not.

Votes

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
community guidelines
New Here ,
Nov 23, 2021 Nov 23, 2021

Copy link to clipboard

Copied

LATEST

Thanks for clarifying this.  I studied this forum (and elsewhere), plus studied the Adobe documentation and couldn't figure this out.  Your explanation helps alot and clears things up.  Thanks.

Votes

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
community guidelines