Variables can be assigned to everything
Variables can be defined in several places throughout the Profile/Checks/Fixups editor. Variables may be assigned to virtually every control including the severity for a check:
- Text input fields
- Pop Up fields
- On/Off switch in order to enable/disable Checks or Fixups in a Profile
Assign a variable
When you click on a variable icon in the pdfToolbox Profiles/Checks/Fixups editor, you will see a list of all variables that are present in the system. Variables that are used in the current context (e.g. the current Profile) appear at the top. You may pick any of the existing variables, create a new one or edit one that is already assigned.
Please note: If variables are used for resources (example ICC profiles), then the name is used in desktop (also listed in a popup like shown above). For example: Desktop (AskAtRuntime): "ISO Coated v2 (ECI)"
But in the CLI you have to use a valid path to the resource (example ICC profile) - because the resource is not in the profile (.kfpx). For example: "--setvariable=<myVAR>:etc/ICC profiles/ISOcoated_v2_eci.icc"
Also note: It is recommended to use --setvariablepath for variables that references a file (--setvariablepath=<path>). Works the same as --setvariable but checks for the existence of the referenced file or folder. If it is used with --dist (Distributed processing) the referenced file or folder is transferred to the Satellite.
Managing and deleting a variable
Deleting a variable is currently only possible in the Library Manager (Library drop down> Manage Libraries) and only if the variable is not used. Whether or not a variable is used can also be seen there (as shown in the screenshot below).
Variable Editor: Creating a new variable
For Checkboxes and Pop ups you can use the info button to pick one of the possible default values
Note: Please make sure to define a proper default value when defining a Variable based on a PopUp. Even if local ressources (e.g. curve files for the Fixup "Adjust dotgain") are used (which can be replaced by a path to a ressource during runtime), there must be a default value defined.
Constraints can be defined by using the "Limit input values to specific values" checkbox in the variable editor. In this context the expected value type of the variable is important which is indicated above of input field for the default value.
You may in addition specify:
- whether a Browse button shows up when executed in pdfToolbox Desktop that allows a user to pick a file from the system (e.g. to load an ICC profile)
- whether the entries in Values are used as list, in which case a Pop up would show up in the dialogue of pdfToolbox Desktop or as a range. In the latter case invalid values that are out of range will be indicated by a red cross.
Constraints - Range specifics
When you are using the Range option, two values will define a range and a single value defines a single allowed value. In this example 100-300 and 500 are permitted values (which usually does not make sense).
Constraints for Pop up fields
You may again use the info button in order to pick possible values for the Pop up. In this example this is done for a severity, but it works in the same way for other Pop up fields.
Profile Script Scope
Variables in Processplans
It is possible to define a variable as a step in a Process Plan. This will work similar to a Variable on Profile level in does only makes sense and work for Script variables.
The "Ask at runtime" in pdfToolbox Desktop
In pdfToolbox Desktop a dialogue shows up, when a Profile/Check/Fixup is executed that has editable variables, i.e. variables that are not calculated by means of Scripts. If you want to see the dialogue for a Profile/Check/Fixup that only has calculated variables you will have to add one additional variable that is not calculated.
Script variables are hidden as long as no evaluation errors had occurred. If an evaluation error has occurred the OK button is disabled. Details can be displayed by clicking the “Inspect variable” checkbox. It allows you to analyze the structure of all variables in the given context.
You can toggle between the label and key of a variable in the variable dialog using Strg/Cmd +K.
The above dialog upon pressing Strg/Cmd +K look like below: