JAVASCRIPT

Top  Previous  Next

Syntax

 

javascript "text"|{expr}

 

Description

`

This command adds document-level javascript to the pdf document.  This code is executed as the document opens, so can be used to invoke actions when the document is opened or to define functions for use in annotation actions specified with a javascript: url in the annotate command.

 

Examples

 

javascript "function showMessage(msg) { alert msg; }"

 

prejob{

crlf$=$0d0a$

js$="function showMessage(msg)"+crlf$+"alert msg;"+crlf$+"}"

}

javascript { js$}

 

 

Drivers: pdf only