Skip to main content
Dmitriy K.
Known Participant
July 20, 2020
Answered

How to make a menu item a privileged function

  • July 20, 2020
  • 1 reply
  • 1255 views
app.addMenuItem({ cName: "A4", cParent: "Help", cExec: ttt});
app.beginPriv();
var ttt = "app.newDoc(420,595)";
app.endPriv();
This topic has been closed for replies.
Correct answer try67

I have "Developing Acrobat® Applications Using JavaScript™" and "JavaScript™ for Acrobat® API Reference", but it all works for Acrobat DC and only partially for Acrobat Reader DC!

Where can you see what 100% works for Acrobat Reader? of course I mean javascript


If you see an "X" in the right-most box of the "quick bar" under the method/property name, it means it's not accessible in Reader. For example:

 

In addition, there are some properties that are Read/Write in Acrobat, but Read-Only in Reader. That will appear in the property's description. For example:

 

1 reply

Bernd Alheit
Community Expert
Community Expert
July 20, 2020

One sample:

 

trustedNewDoc = app.trustedFunction( function (nWidth, nHeight)
{
// Additional code may appear above
app.beginPriv(); // Explicitly raise privilege
app.newDoc( nWidth, nHeight );
app.endPriv();
// Additional code may appear below.
})

info: newDoc will not work in Acrobat Reader.

 

Dmitriy K.
Known Participant
July 20, 2020

Thanks for the help! Where can I see a list of functions that will not work in Acrobat Reader?

Is there any other way to use code in Acrobat Reader?

Bernd Alheit
Community Expert
Community Expert
July 20, 2020

Look at the methods in the Acrobat Javascript reference.