[Tex/LaTex] Example of Javascript form within pdflatex

javascriptpdftex

  1. Can someone please show me an example of how to include a simple Javascript form within a pdflatex document?

  2. Can someone please show me an example of accessing and modifying the PDF file's DOM from Javascript within a pdflatex document?

  3. Is there some reasonably friendly document to describe how to intermix PDF and Javascript?

Best Answer

You might try the manual to the eforms package. eforms is another interface (other than hyperref) for creating PDF forms in TeX. The manual includes many simple examples.

There is no DOM in PDF. If you want parts of the PDF to change based on form events, you pretty much have to make those changing things read-only text fields.

For intermixing JavaScript and your TeX code see this demo of the insDLJS package

Both of the docs (and the packages they document) are written by D.P. Story, who is extremely prolific in this area. His acrotex bundle has many more examples.