Skip to main content
Known Participant
May 21, 2020 1:27 PM UTC
Question

What is the preferred way of adding a menu to adobe Reader C++ Plugin or JavaScript plugins ?

I have a question , Will adobe continue to support JavaScript to add menus to adobe in future. Which is the standard way. I have read documentation https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FOverview_UsingSDK%2FDeciding_between_plug-ins_and_JavaScript.html  when to use what, I can achieve it using both plugin and javascript.  Which one is best

This topic is closed to new replies. Start a new post to keep the conversation going.

7 replies

Thom Parker
Community Expert
Community Expert
Jun 3, 2020 5:55 AM UTC

The Acrobat JavaScript function "app.addMenuItem()" adds a menu item to an existing menu, it cannot create new top level menus. Top level menus can only be created with a plug-in. Which you use depends on what you want to achieve, and your capabilities. I use both. And some times I mix them up. I'll create a plug-in to add a top level menu. Then add items to it with JavaScript. 

 

There is no reason to think that any of the menu item functions in the plug-in SDK or the JavaScript model are going to go away. These are very important user interface items.  

But if Adobe did decide to take them away, be assured they wouldn't consult with us first. . 

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
Mar 14, 2024 2:26 PM UTC

Hello,

 

I've added a menu item in adobe wiht java script

app.addMenuItem({

cName: "NEW MENU ITEM"
,
cParent: "File",

cExec: "mySaveProc();",

cEnable: "event.rc = (event.target != null);",
nPos: 7
});

 

But now with the New Adobe Reader I can't see the menu. I've change cParent: "File", to cParent: "Menu", but no result.

So how can you a menu item in the New version of Adobe Reader.

 

Thx

Translate
Thom Parker
Community Expert
Community Expert
Mar 14, 2024 4:42 PM UTC

The top menu in the new UI is "AV2::HamburgerMenu". Some of the old top menus are still there, such as View, Window, and Help, but there's no "File" menu. 

 

I'd suggest reverting to the old UI.

 

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Legend
May 21, 2020 1:49 PM UTC

Adobe don't announce anything in advance. They haven't said anything about things going away, nor promised that they will not.  Personally, I'd use a plug-in because I'm a C++ programmer used to writing plug-ins. But to write a plug-in for Reader will cost you plenty. So JavaScript may be better for you.

Translate
SyamalaAuthor
Known Participant
May 21, 2020 2:37 PM UTC

Thank you very much for all the support you gave for a new bee like me. Much appreciated 🙏

Translate