Using Variables for resources

It is possible to set a Variable for the resources in a Profile, Fixup, Action, etc. (for example for an ICC profile or an Output Intent). The handling is different between pdfToolbox Desktop and the CLI version.

Difference between pdfToolbox Desktop and pdfToolbox CLI

If a Variable is used for resources in pdfToolbox Desktop (in this example an ICC Profile), the names of all possible resources are listed in a drop-down menu in the Ask-at-runtime dialog during Profile execution. Simply select the desired ICC Profile and the resource is immediately available.

If you want to execute the Profile on the CLI, you have to use the absolute path to the resource because the resource is not part of the Profile.

In order to set a Variable for a resource the following call may be used:

./pdfToolbox --setvariable=<myVAR>:<absolut path to resource> sample.kfpx sample.pdf
Click to copy

You can also use --setvariablepath. This works the same as --setvariable but checks for the existence of the referenced file or folder.

./pdfToolbox --setvariablepath=<myVAR>:<absolut path to resource> sample.kfpx sample.pdf
Click to copy


Here is an example of how to assign the ICC profile "ISO Coated v2 (ECI)" to the Variable "varDestination" on the CLI.

./pdfToolbox --setvariable=varDestination:/Applications/callas\ pdfToolbox\ Server\ 14/cli/etc/ICC\ profiles/ISOcoated_v2_eci.icc /Users/Username/Desktop/Convert\ colors.kfpx /Users/Username/Desktop/Sample.pdf 
Click to copy

If only the name of the resource is specified on the CLI, e.g. --setvariable=varDestination:"ISO Coated v2 (ECI)", an error message would be displayed because pdfToolbox does not have access to the resource.