Autocomplete while writing JavaScript

callas pdfToolbox includes a full JavaScript editor to allow writing JavaScript variables, configurations for QuickChecks, imposition run lists and so on. This editor of course understands modern JavaScript syntax, but the different places where it is used also support custom objects and syntax added by callas.

Typically this is done to make the bridge between the JavaScript engine and the callas processing engines, much like JavaScript in a browser has access to a Window object to make the connection to the browser window in which HTML is shown. In order to write effective JavaScript, it's important to know which objects are available. This can be done by using the information button and then selecting "Insert JavaScript objects".

This brings up a dialog box where the different JavaScript connection objects can be seen. Starting with pdfToolbox 14 however, there is a much faster way to find the correct connection object, and this is simply to start typing the first letters of one of these connection objects. The editor in pdfToolbox immediately shows a list of all objects that start with the letters you already typed. You can continue typing, or scroll the list to pick one of the options displayed.

Where does this work?

This type of autocomplete works in many of the editors where JavaScript is used, such as:

  • The script variable editor
  • The QuickCheck configuration editor