pdfToolbox in the cloud- The concept of variables

Variables as used in pdfToolbox are small information objects that have been around for quite a while.

Each data object for a variable has four properties:

  • a key (for use when configuring values in Process Plans, Profiles, Checks or Fixups, and for working with variables in JavaScript)
  • a label (for use in the user interface, for example in the "Ask at runtime" dialog)
  • a value (either, in the case of a simple variable, a default value to be used unless a different value is provided at runtime, or a JavaScript that once evaluated will return the applicable value)
  • an internal unique ID (not displayed in the user interface, but can be retrieved using JavaScript)

Why variables?

Variables make it possible to determine some information that is useful when executing a Process Plan, Profile, Check or Fixup at the time of execution, instead of having to predefine such information beforehand. 

A simple example would be a Check that analyses the minimally required  resolution of images. Sometimes 300 ppi are needed (for high quality printing, in other cases 72 ppi or 96 ppi could be sufficient (when sharing a PDF via email). While it is possible to configure three separate Checks for 300 ppi, 96 ppi and 72 ppi, it is much more elegant to only define a single Check, where a place holder is used which is then filled when executing the Check. Not only is just one Check needed instead of three, it is also absolutely easy to use the same Check for altogether different required minimal resolutions, like 144 ppi or 450 ppi or any other value.

Thus, the major benefit of variables is the option to postpone the decision, which values to use for processing PDFs, to the moment when processing is started. This includes the possibility to choose different values each time. Furthermore, the introduction of JavaScript makes it possible to derive further information based on information provided at runtime or based on information through metadata, including the option to use relative complex calculations.

Understanding variables in the context of pdfToolbox requires  to understand not just what pdfToolbox can do but also what a Profile is. Please read more about creating Profiles and variables using pdfToolbox Desktop.