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.




Related Products at PDF Store

PDF Download

PDF Download removes the pain of dealing with PDF files on the web and is one of the most popular Fi... View full product details
Download free demo

PDF Multi Print

Command line instruction printing tool + alternative graphical interface.... View full product details
Download free demo

PDF Snake

Imposes (n-up), stamps watermarks, makes booklets, splits pages, and adds bates numbers. 30-day, unl... View full product details
Download free demo

PDF In-Depth Free Product Trials Ubiquitous PDF

Nitro PDF Professional

the perfect PDF product for business and enterprise, combining an extremely competitive price with a...

Download free demo

XpdfViewer

This ActiveX control (OCX) provides a PDF file viewer component, enabling developers to add PDF viewing...

Download free demo

Ubiquitous PDF: PDF eBooks-Library

If you are looking for a good store of PDF content, you could do a lot worse than visiting eBooks-Library.com...

September 03, 2009
Search Planet PDF
more searching options...







Download PDF Creator

Download The Best of Planet PDF volume 2
Planet PDF Newsletter
Most Popluar Articles
Features

Collating PDFs using JavaScript

Despite the numerous benefits, there can be potential issues with the conversion of paper documents into electronic archives. When scanning paper pages into PDF, it's possible to end up with the odd- and even-numbered pages in separate PDF files. It can be very time-consuming to collate them manually, but there is an easier way. Sean Stewart explains.

Featured Product

BCL easyPDF SDK

BCL easyPDF SDK is a set of PDF Programming Libraries designed specifically to help Software Developers / Programmers build and deploy enterprise class PDF applications for corporate wide PDF...

Platinum Sponsor
Create & Edit PDF - Nitro PDF Software

ARTS PDF

Silver Sponsors

PDF-Tools enfocus

QuickPDF: The Unrivaled PDF Developer Toolkit