Arbitrary JavaScript controlled Checks

pdfToolbox 13 introduces "Arbitrary JavaScript controlled Checks" which works similar to the Fixup "Arbitrary JavaScript controlled Fixups".

Setting up the Check

It has two areas, one for the actual JavaScript configuration (1) and one for the resources (2).

Two info buttons, (3) and (4), at the right side allows to insert preconfigured information.


While a Fixup may use various types of resources, the only resource that can be used in a Check is another Check.

Such resources can be used in "Include other check" and most of the "Context aware object detection" (Sifter) Check properties.

Please note that JavaScript may also be used instead of such a resource.


The main JavaScript area

The easiest way to create a JavaScript based Check is to first create it as a regular Check and then insert it as configured Check.


This opens a new dialogue that lets users pick a previously configured Check.

As an alternative, "Insert base Check..." might also be used which lets you configure one Check on the fly.

In both cases, a structure is created that the users can then modify which can be created in a similar way using JavaScript code.

Everything that is specific to this particular Check property is in the conditions array (1).

All other parameters represent something that is common to all Checks, basically what is on the left hand side of the Check editor (2). This is the name, the comment etc. E.g. the parameter "Fire if any condition is met" would be reflected by

"condition_logic" : "or"

Check or condition

In the example above, would everything that is entered on the left side be overwritten by the values in the JavaScript code? Yes, it would.

However "Arbitrary JavaScript controlled Checks" also allows to use the conditions array alone.

In this example, there only is the conditions array. In that case, the name, comment etc. are taken from the left hand settings of the Check.

This Check now may also be combined with other conditions, by "loading" them from the Property list.

Values for pop up/drop down lists

Users may want to find out about the proper values for a Check that uses a Pop up, e.g. for  "Sequential page number" that may have various operator values, like shown below.

Here the "Open list of all base Checks" option comes into play.

(Go to 'Arbitrary JavaScript controlled Checks', click on the 'i' info button)

It opens a list of all existing Check properties in your web browser. Considering our example, search for "Sequential page number":

Any of the listed values for "operator_properties" can be used to configure the Check in your JavaScript code.