Convert to PDF

⚠ Experimental Feature

This feature is Experimental and may change based on user feedback and testing. Share your thoughts with our team to help us improve it.

The Convert to PDF block enables document conversion into PDF format, streamlining file standardization and ensuring compatibility across various platforms.

This block allows users to transform documents, images, and other file types into PDFs, making them easier to share, store, and process in automation workflows.

Example: A Word document can be converted to PDF using this block and then processed by another automation step, such as emailing the PDF as an attachment.

Note: This feature is available starting from Release 2025.1.173.

Fully expanded, the Convert to PDF block shows the following properties:

convert-to-pdf

The Block Header ("Convert to PDF")

The green input connector in the header is used to trigger the block to start executing.

The green output connector in the header triggers when the file type has been successfully converted to PDF.

The title of the block “Convert to PDF” can be changed by double-clicking on it and typing in a new title.

File Input

The Convert to PDF block supports multiple file formats as input. The file content can be dynamically provided from other blocks within the automation flow.

Source Type

Once you drag the file into the block, the block will automatically recognize the file type. 

A user can choose any of the below options as a source type:

  • Data File: File for upload will be saved inside of Leapwork.
  • Local Path: File for upload will be referred to from a specified path.

Select file to convert

This field allows you to drop the file that is to be converted.

Text fields

In the Convert to PDF block, text fields allow the use of external values (dynamic data) when Local Path is selected as the source type.

To insert a field value, right-click the text field below the Local Path label and choose Insert token, then enter the name of the field.

Fields can be renamed by double-clicking on them; any inserted tokens will automatically update their visual representation to match the new name.

File

This property represents the output of the Convert to PDF block, which is a PDF file; the blue output connector is triggered once the file has been successfully converted, allowing it to be used as input in subsequent building blocks.

Failed

This connector is triggered if the Convert to PDF block fails to convert the file due to reasons such as unsupported formats, file corruption, inaccessible paths, or exceeding the specified timeout duration.

Default Timeout

If the Default Timeout property checkbox is not selected, then the timeout value is 10 seconds. If the Default Timeout property checkbox is selected, then the Default Timeout value selected in the flow settings will be applicable.

Timeout

The maximum time spent converting the file type before giving up and triggering the Failed connector.

Note: All cases have a global timeout that can be configured in the Settings panel. This is unrelated to the timeout of a single building block. However, a running case will automatically be cancelled if it runs for longer than the global timeout.

Download

To download the resulting PDF file generated by the Convert to PDF block, use the Save file block to save the output locally.

 

Updated  07.04.25