How To Articlesby Thom Parker of WindJack Solutions.
Copyright © 2004 by WindJack Solutions
The main difficulty in developing a
folder level script is that it is necessary to restart Acrobat
when you want to load and test new code, a very time consuming
operation. For this
reason it is best to adopt a method that reduces the number of
times you will have to restart Acrobat.
In order for folder level code to be used
for task automation it must be made available to the user
through a UI element. There are two such elements in Acrobat,
Menu Items and Toolbar Buttons. A Menu Item is by far the
simplest to implement since it only requires a single line of
First, code executed from a toolbar button has about the same security restrictions as document level JS. Mostly, this restriction includes operations that might be used in a malicious way, like document, page, and template creation. This situation really isn't that serious since most of the Acrobat JS methods don't require high security and if the code you are writing does require high security, the button could simply act as a front for a menu item, giving you the advantages of both a menu item and a toolbar button together.
The second draw back is that a Toolbar Button requires JS Code to create the icon to be displayed on the button face. Specifying this icon is quite difficult and poorly documented in the Acrobat JS documentation. If you are interested in creating your own Toolbar Buttons you should consider purchasing AcroButtons, which is the only tool currently available for creating and managing JS Toolbar buttons. It is also very helpful in other ways for developing folder level scripts. There is another tool, which is not intended specifically for creating JS icon data, but can be used for this purpose. That tool is PDF CanOpener.
Good luck and send us any comments you have on this article. email@example.com