Javascript
Javascript support allows interactive functions in the PDF file. Javascript allows alsort of interactions to happen in a PDF file.
PDF forms to be generated dynamically and components can interact together (for example a calculator program uses Javascript to fill in the answer box or it could be used to validate input). Javascript also provides lots of validation functions (ie check numeric values, limit input length, exclude certain keys).
Javascript can also be used to control Layers allowing different views to be displayed (for example in this hangman game)
JPedal uses the Rhino library and lots of custom code to provide Javascript support for both PDF Forms and other functions such as Layers.
Custom JavaScript
You can add your own JavaScript code to edit the forms, all you need to do is
All actions allowed follow the standard Adobe PDF JavaScript code. We will parse your string and alter it to suit our library and keywords, so dont worry about refactoring, you can add it just like you would to the PDF file on creation.
The String you send in must be valid JavaScript, and use the same variables the PDF defines.
You will have to consult the PDF spec, and PDF files for examples of JavaScript,
but if you are having trouble please contact us making sure to specify:
- That you are trying to use our JavaScript.executeAction to do it.
- What you are trying to do.
- The code you are sending in.
and we may be able to point you in the right direction.




