Skip to main content

Convert to PDF

Current configuration of the Convert to PDF task in the Workflow Designer

The Convert to PDF task is designed to take an input file (such as a text document, image, or spreadsheet) and convert it into a PDF document, making it available for subsequent tasks.

Configuration

The task configuration allows you to specify the source file and, optionally, the destination for the generated PDF.

  • File to import: Enter the full path of the file to be converted in this field. It can be a static value or, more commonly, a dynamic parameter from a previous task or workflow parameters.

Customising the Output Path

The default behaviour of the Output Path depends on how the source file is provided:

  • Case 1: Input via "File" type Parameter When the file is passed as a dynamic parameter from a previous task or workflow parameters, the converted PDF is saved in a system-managed directory.
  • Case 2: Input via Manually Written Path When you write the full path of an existing file directly in the "File to import" field (e.g., /data/input/report.docx), the converted PDF is saved by default in the same directory as the source file (i.e., in /data/input/).

Alternatively, by selecting the File Path checkbox, you can specify a custom destination. The following fields will be displayed:

  • Output path: Enter the folder path where you want to save the converted PDF file here. This field can also contain a static value or a dynamic parameter.
  • Create path if not exists: If this option is enabled, the task will automatically create the folder structure specified in "Output path" if it does not exist. If disabled, the task will fail if the destination folder is not present.

Output Parameters

Once the task has completed the conversion, it exposes the following output parameters:

  • file: Returns the full path of the newly created PDF file (e.g., /path/output/document.pdf). This parameter is ideal for passing the file to subsequent tasks, such as sending an email with an attachment.
  • filename: Returns only the name of the generated PDF file (e.g., document.pdf).
  • result: Indicates the overall status of the conversion operation (e.g., "Success" or an error message).
  • resultJson: Represents the result of the task execution in JSON format, including general information, configurations, and execution details.