
Adobe Acrobat SDK
Creating Menus and Menu Commands
Developing Plug-ins and Applications
Determining if a menu item can be executed 96
Determining if a menu item can be executed
In previous versions of Adobe Reader and Acrobat, it was possible for a document to execute a menu item
in the viewing application using a Named action or the
app.execMenuItem
JavaScript method. These
two features, referred to as
ExecMenu
expose all menu items to the document, potentially allowing a
malicious document to compromise a user’s privacy or system. For example, it was possible to use the
app.execMenuItem
JavaScript method to obtain data from a document by creating the equivalent to a
user selecting the menu sequence of Select All, Copy, and Paste.
Acrobat and Adobe Reader 8.0 contain a list of menu items which can be executed using
ExecMenu
. Any
menu item not on the list cannot be programmatically executed.
You can determine if a menu item can be programmatically executed by invoking the
AVMenuItemIsScriptable
method and passing an
AVMenuItem
. This method returns a Boolean
value. That is, if the menu item that corresponds to the
AVMenuItem
argument can be executed,
True
is
returned; otherwise,
False
is returned.