These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Can Javascript Get a Link or Button to Call any Menu Action?

dowillem
Registered: Mar 18 2006
Posts: 6

When Adobe updated from ver. 7 to ver. 9, they took away one of the greatest functionalities the program had to offer. I routinely configured links, buttons and bookmarks to call up most any function Acrobat accessed via the menus, such as:
. "Scroll" [Shft-Ctrl H]
. "Read Out Loud" [Shft-Ctrl Y]
. "Stop Reading Aloud"
. "Hide Toolbars" [F8]
. "Menu Bar" [F9]
. "Exit" [Ctrl Q]
 
; and the list goes on. Versions 8 & 9 restrict users to ONLY a reduced set of menu commands that Adobe somehow figured was sufficient. Adobe took functionality away from Acrobat instead of improving it! Heck, I had wanted to expand on the ability to configure a button to scroll at a specified speed or read only a certain paragraph. Or how about a preset zoom to a specific size zoom. Forget it! Don't even bother anymore - can't do any "cool" features.
 
Problem is, I haven't been able to figure how work around this constraint in Acrobat. What I sincerely hope for is that a Javascript Guru can spell out how to overcome this with code in place of the Version 7 ability to call most menu items.
 
Is this doable using Javascript? (doesn't matter whether link, button or bookmark)
 
Don

My Product Information:
Acrobat Pro 9.2, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
It's possible to use JavaScript to execute some of the restricted menu items, but it involves installing a custom JavaScript file on each user's machine. For more information, see: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.143.php
dowillem
Registered: Mar 18 2006
Posts: 6
George, thanks for the feedback and the confidence, but would anyone be able to write such code on this forum? I'm afraid this is way past my level at this time to do in Javascript.

Question: are you saying that if I place such code in my file that it wouldn't work on other's machines cause they don't have the script installed on their machines? That wouldn't be useful at all! Isn't there a way that the file transmitted to others could carry the necessary code in a link, button or bookmark?

Don
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
I know Thom Parker has article on creating folder-level JavaScripts. Try searching here for it.

Yes, each user would need a folder-level JavaScript installed. It's useful in that it's one possibility to execute restricted menu items. You could include the file as a file attachment in a PDF, and include instructions on how to install it.

I've long thought that a nice feature to add to Acrobat would be a streamlined method for installing folder-level JavaScript files included in a PDF.

As the documentation is provided a link to mentions, you can also include the code in a certified PDF.
dowillem
Registered: Mar 18 2006
Posts: 6
George, thks., but writing scripts seems very complex - I hope to learn it but not sure how. All the discussion on JS I've seen seems like Greek to me so far. And if I manage to make it work, I see I would have to sit with numerous people to get them to load the JS code on their machines - really isn't practical, though I would be tempted to try it.

How to protest to Adobe to get them to restore what they took out of the program?

Don
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
It's really not too complicated. You just need a single line of code for each menu item you want to execute. The documentation I pointed you to has a general purpose function (example 4) that you can use. And there is a tutorial here that tells you about folder-level JavaScripts.

You can post a feature request here: http://forums.adobe.com/community/acrobat/acrobat_feature_request

but I have to say that I think it's exceedingly unlikely that they will change this back. It was changed due to valid security concerns. You may have seen that the upcoming Acrobat 10 has far fewer menu items.