The pdfToolbox Rest API - Using Variables

Some Preflight profiles can be customized through variables. Variables allow the same profile to be used with different input values without modifying the profile itself.

For example, a profile may contain a variable for a trim size, color name, customer identifier, or another processing option. Your application provides the value when submitting the Preflight request.

When to use variables

Use variables whenever a Preflight profile is designed to accept user-defined values.

Typical use cases include:

  • Customer-specific processing
  • Dynamic page or trim sizes
  • Configurable color values
  • Production workflows with changing parameters
  • Reusing the same profile in different workflows

Providing variable values

Variable values are supplied as part of the Preflight request.

Each variable consists of:

  • a variable key,
  • the value that should be assigned to that key.

The variable keys must exactly match the variables defined by the selected Preflight profile.

Discovering available variables

Rather than hardcoding variable names, applications should retrieve the supported variables from the selected profile before submitting a Preflight request.

The Retrieve Profile Variables operation returns the variables defined by a profile, allowing applications to:

  • build dynamic user interfaces,
  • validate user input,
  • construct valid Preflight requests automatically.

Recommended workflow

When working with configurable profiles, the recommended workflow is:

  1. Select the Preflight profile.
  2. Retrieve the variables defined by that profile.
  3. Collect the required values from the user or another system.
  4. Submit the Preflight request with the completed variable set.
  5. Retrieve the processing results.

Best practices

  • Retrieve variables dynamically whenever possible instead of hardcoding variable names.
  • Validate user input before submitting a request.
  • Reuse Preflight profiles by changing variable values rather than creating multiple similar profiles.
  • Keep variable names consistent to simplify automation and maintenance.