Document level javascripts

Hans Hagen pragma at wxs.nl
Tue Dec 8 17:51:16 CET 1998


Steve Kachman wrote:
 
> As I understand it document level javascripts need to be defined
> before the first page. Can this be done using PDFTeX?

Yes, but you need to generate the appropriate data structures (quick and
dirty i.e. flat, or as libraries). 

In ConTeXt javascripts can be defined in the document itself (or loaded
from modules), optionally included when called for, they are accessible
to the reference mechanism, sanatized when copied to the pdf file, etc.
Some examples of JS support are calculat.pdf and 1998-001.pdf at
www.ntg.nl/context (examples.htm and uptodate.htm). 

For your purpose a maybe more convenient method is to put the scripts on
the plug-ins directory, where they are loaded at startup. 

Beware, the current JS interpreter is rather buggy, non reentrant when
an error occurs and has leaks between documents. The tex-pdf-tex-pdf
edit debug cycle rather cumbersome. 

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | fax: 038 477 53 74 | mail: pragma at wxs.nl
-----------------------------------------------------------------





More information about the pdftex mailing list