THE UNIVERSITY OF AKRON
Theoretical and Applied Mathematics
The insDLJS Package: Demo the
execJS and defineJS Environments
D. P. Story
c© 1999-2002 dpstory@uakron.edu
October 9, 2002
Section 1: Introduction
2
1. Introduction
This document demos two environments, defineJS and execJS, de-
fined in the insDLJS Package, a stand alone package distributed with
the AcroTEX eDucation Bundle. The example presented here is an
animation (of sorts) created completely from a LATEX source file that
utilizes these two environments.
2. The execJS Environment
The execJS environment can be used to create “executable and dis-
cardable” JavaScript. The applications of this environment are very
exciting (to me), however, the full Acrobat product is required to make
it work; more exactly, Acrobat 5.0 or greater is required. It should be
emphasized, however, that the document author can create the PDF
document using the Acrobat distiller, pdftex or dvipdfm, the Acrobat
Viewer—not the Acrobat Reader—is needed to import and execute
the JavaScript.
The execJS environment is used to write JavaScript. When the
document is LATEXed, the script is written verbatim to an FDF (Forms
Section 2: The execJS Environment
3
Data Format) file. The environment also adds an open action, so that
when the newly created PDF document is opened for the first time in
Acrobat, the FDF file is imported and executed. After the JavaScript
has executed, the next thing to do is to save the document. The FDF
that is imported is not saved with the document, and will not be
imported again into the document, thereafter. The document is then
ready for distribution.
Important: This environment, and the technique on which it is
based, described next, is used for “post-creation” document adden-
dum; that is, after the document is created, the JavaScript that ap-
pears within the execJS environment, is executed. This script can
perform a variety of tasks such as importing sound or PDF icons.
2.1. Security Restricted Methods
If the JavaScript you want to execute has no securi