Changes

Jump to navigation Jump to search
797 bytes added ,  08:07, 2 April 2015
Comments about defiencies in MkIV, information about JavaScript in Acrobat
\goto {advance by one} [JS(increment)]
</texcode>
 
'''Beware''', in MkIV (as of 2015-04-01) the JS code is only copied to the PDF if there is a \goto referencing one of the defined functions!
You can pass values to a JS function:
* JS_V_n, JS_S_n, JS_R_n are the names of the variables
* JS_N keeps the number of arguments
 
== Documentation ==
 
JavaScript in Acrobat is different than in a web context. Documentation is even more sparse that on ConTeXt ;)
Debugging is only possible in Acrobat Pro, and also there very inconvenient.
Additionally, Acrobat’s possibilities change with every version.
 
* [http://www.adobe.com/devnet/acrobat/javascript.html JavaScript documentation at Adobe’s]
* [http://help.adobe.com/livedocs/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/wwhelp.htm?href=JS_Dev_Tools.72.1.html&accessible=true JavaScript API Reference for Acrobat 9]
=Fields=
Beware, for fillinfields in MkIV you need {{code|\usemodule[fields]}}!
They’re meant for clozes (texts with gaps, like in questionnaires).
 
In MkIV (as of 2015-04-01) default values are always used verbatim, i.e. JS() doesn’t work.
Other fields you must first define and then use. That might look complicated, but you can use the same field several times, and the contents will automatically repeat themselves if you need the same content at several places, even on different pages.

Navigation menu