PDF In-Depth

Popup Menu Programming in Acrobat JavaScript

About the Author
 

Thom Parker

WindJack Solutions founder Thom Parker has been developing solutions for Adobe software since 1997. WindJack Solutions' focus is PDF development and Thom is actively involved in all things PDF. He developed two innovative tools for PDF developers and users, PDF CanOpener and...  More


 

 
 

The popup menu is one the most useful and easy to use User Interface Items available to the Acrobat JavaScript programmer. Unlike many of the other UI options (buttons, edit fields, lists, etc.) it can be used in Folder level scripts as well as at the Document level and lower. Document level scripting is primarily used for forms related operations and document navigation, and for this use Acrobat provides a rich set of UI elements that have been well covered in the industry literature. Folder level scripting on the other hand, is primarily used to either automate tasks in Acrobat or to provide general utility functions for other scripts. There are relatively few UI elements available to the JS programmer at the folder level, making the popup menu even more valuable for this purpose.

If you develop folder level scripts using popup menus there are a couple of things you need to be aware of. First, a popup menu will only appear on top of a document window, no open documents means no menu. Second, Acrobat tries to place the menu at the last cursor location, or as close as it can get to it. You will have to watch carefully to see where the menu "pops up." It may actually appear somewhere around the edge of the document window. Debugging folder level scripts is also a bit troublesome since Acrobat has to be restarted every time the script is changed.

Acrobat JavaScript provides 2 methods for creating popup menus, app.popUpMenu (introduced in Acrobat 5.0), and app.popUpMenuEx (introduced in Acrobat 6.0). Both of these methods are very similar in how they operate. The newer method, popUpMenuEx, is slightly more complex, but offers a variety of useful options.




PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Quick PDF Library

Get products to market faster with this amazing PDF developer SDK. Over 900 functions and an equally...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor





Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Features

Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.