Taking variables to the next level
Variables have originally been introduced in 2009 in pdfToolbox 4, and have proven to be a very flexible and powerful instrument to develop efficient workflows. Based on extensive feedback from our customers and OEM partners, we have extended the way variables work in pdfToolbox in several ways:
- More aspects of profiles, checks and fixups can be handled through variables; for example, it is now possible to turn checks on or off, change their severity, or to use variables for check boxes and pop-up menus
- Variables are now self contained data objects; this is especially useful where the same variable is used in more than one place; in the past, a pdfToolbox user had to ensure that the same variable used in more than one place was using the exact same configuration string.
- Variables can now also be used as a step in a Process Plan, such that the execution of the following steps can depend on the evaluation of the variable in this step.
The concept of "variables"
Variables as used in pdfToolbox 9 are small information objects that come in two flavors:
- simple value variables
- script based variables
Each data object for a variable has four properties:
- a label (for use in the user interface, for example in the "Ask at runtime" dialog)
A variable can be used in almost any context where something can be configured in any of the following:
- Process Plans
- Steps in Process Plans
- Checks used as filters in Fixups
The places where variables can be used are for example:
- name and description fields
- fields of type check box, popup, or input fields for text or numbers
- severity for Checks and Fixups inside a Profile
- ON/OFF switch for Checks and Fixups inside a Profile
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.
Variables in the desktop, server, and command line SDK versions of pdfToolbox 9
In principle not much has changed here in comparison to pdfToolbox versions before version 9. In the desktop version of pdfToolbox 9 (whether Acrobat plug-in or standalone), when running a Process Plan, Profile, Check or Fixup that contains one ore more variables for which input is needed, the "Ask at runtime" dialog will open and will request that user enters values as desired (or leaves the pre-populated default values as they are). For the server and command line versions, the values have to be provided as command line parameters or by means of a configuration file.
What has changed - mostly due to the extended capabilities - are the following:
- Values entered by the user have to be suitable for the type of field for which they are to be used; for example, it is now impossible to provide arbitrary text when the expected value is a number.
- Additional information is provided to the user in the "Ask at runtime' dialog in case there is a problem with the value(s) entered.
- Using a special option in the "Ask at runtime" dialog, it is possible to analyze the way variables are collected or calculated; this not meant to be used by the typical user, but rather by the person in charge of developing advanced uses of variables – which could become quite complex in Profiles that use variables in many places in Checks and Fixups.
- several pdfToolbox specific internal data objects, in order to allow for access to document metadata, filename, and so on; and to store data in a place shared across Process Plans, Profiles, Checks and Fixups through one execution context.
- pdfToolbox 9 does not offer any access to outside data (except where provided through pdfToolbox specific internal data objects), whether to the local file system, or to web services or data accessible "over the web"