[NTG-context] Forms and JavaScript

Henning Hraban Ramm texml at fiee.net
Fri Apr 3 07:06:32 CEST 2015

Am 2015-04-02 um 21:07 schrieb Rik Kabel <context at rik.users.panix.com>:

> On 2015-04-02 03:42, Henning Hraban Ramm wrote:
>> while trying to create some interactive forms using latest beta (MkIV), I found that JavaScripts are only then copied into the PDF, if there’s a \goto referencing a JS function.
>> According to the old widgets manual I thought I could set default values of fields calling JS functions or variables as [JS(MyFunc)], but that doesn’t work.
> Greetlings Hraban,
> This appears to be a pdf reader problem. On Win 8.1, Windows Reader and Chrome both show an editable field; Firefox and Sumatra show a non-editable field.

That’s not the problem, creating fields works great. Since JS works (probably) only in Adobe products anyway, I don’t care about other viewers. 

But JavaScript code (within JSpreamble or JScode sections) is only copied by ConTeXt into the PDF if there’s a call of \goto to one of the defined JS functions.
Additionally, calling JS functions for default values of fields doesn’t work like it did in MkII (and like it’s documented in m-widgets.pdf).

JS in PDFs is not easy to handle, but ConTeXt should at least copy my code into the PDF as it’s documented and used to work in MkII.

Greetlings, Hraban
https://www.cacert.org (I'm an assurer)

More information about the ntg-context mailing list