Convert to PDF using Nintex Workflow

We recently released the Muhimbi PDF Converter Xtension for Nintex Automation Cloud. You can download it here or learn more about available Muhimbi deployments for Nintex on our product page.

In this guide you'll learn how to convert different file types to PDF using Nintex Workflows. The Muhimbi PDF Converter for SharePoint On-Premises comes with comprehensive support for all Nintex Workflow versions (NW2007 – NW2019). Using Nintex Workflows with SharePoint Online require a more complex process - see the Nintext for Office 365 blog post for addition details.

In this example, a Nintex workflow retrieves all the files modified during the current day and converts them to PDF. In an ideal setup, you will schedule this workflow to run out of office hours to batch-process all new and modified files.

To create a new workflow, you can follow the instructions below or download the complete workflow in NWF format from the following link:

Nintex Workflow to retrieve and convert files to PDF

nintex workflow convert pdf

Prerequisites

Before we start building the workflow, ensure all prerequisites are in place. It is also assumed that the reader has some knowledge of building Workflows using Nintex Workflow.

  1. Make sure the PDF Converter for SharePoint On-Premises version 4.1 (or newer) is installed in line with chapter two of the Administration Guide.

  2. Naturally, Nintex Workflow will need to be installed as well.

  3. Make sure the Muhimbi.PDFConverter.Nintex.WebApp SharePoint Feature is activated using SharePoint Central Administration on the relevant Web Application.

  4. You will need to have the appropriate privileges to create workflows.

Creating a new workflow

To get started, create a new workflow and choose the blank template. Ensure the workflow doesn’t start automatically, and add the workflow variables listed in the following screenshot.

add workflow variables

Ensure that the appropriate data types are assigned. They are listed under the ‘Type’ column beside each variable name. The names are largely self-explanatory, but some additional information is provided below:

  • Source Item ID: By default, the item that triggered the workflow is converted to PDF format. However, as we are iterating over multiple items, we need to specify the item’s ID to convert in this variable. In SharePoint 2010 and later, select Integer as the Type, not List Item ID.
  • Source List ID: The PDF Converter assumes the item that is being converted is located in the same list the workflow is attached to. However, if this is not the case, then the list ID (a GUID) will need to be specified as well. In this example, everything is located in the same list, so this variable is not used.
  • Source Files: As we are potentially converting multiple files, we need to define a variable of type Collection to hold the list of files we will be iterating over.
  • Generated PDF Item ID: Once a file has been converted to PDF, you may want to carry out additional actions on this new file. For example, checking it in. Once converted, the ID of the PDF is automatically stored in this variable. In SharePoint 2010 and later select Integer as the Type, not List Item ID.
  • Generated PDF List ID: As the PDF Converter allows files to be written to different document libraries, and even completely different Site Collections, you may want to know the ID of the destination list.

Adding the workflow actions

You are now ready to add the actions to the workflow. You can start by adding a Query List action, allowing you to retrieve all files modified today and store the results in the Source Files collection.

add query list

You can fill out the settings for this action as per the screenshot listed above. You may want to add an additional filter rule to check that Content Type is not equal to Folder or Document Set.

You can continue by adding the For Each action to the workflow. Specify the collection’s name to iterate over and the variable’s name to store the Item’s ID in.

configure action for each

The next set of actions you add will need to be added inside the For Each action to ensure they are executed separately for each file in the list.

You need to ensure that the workflow only invokes the PDF Converter for those files that are not already in PDF format. To achieve this, add a condition and check that the file type equals ‘pdf’ as per the following screenshot.
set condition in workflow

After this, you need to add the Convert file to PDF action listed under the Muhimbi PDF section to the No branch of the workflow condition (as we want this workflow to only convert those files that are not of type pdf). You can fill this section as per the image below:

convert file to pdf

The PDF Converter integrates with all Nintex Workflow versions.

You may want to leave the Destination Path empty, which will write the PDF File to the same location as the source file. For more information about the Destination Path or any of the other fields, hover the mouse over the small information icons.

The workflow is now done. You may want to add some logging information using the Log In the History List action. In our example, we use the following two logging information:

  • Last action in the No branch:
    List ID: {WorkflowVariable:Generated PDF List ID} - List Item ID: {WorkflowVariable:Generated PDF Item ID}
  • Last action in the Yes branch:
    Already in PDF Format: {WorkflowVariable:Source Item ID}

Running the workflow

You can finalize the workflow by saving and publishing it, after which the workflow is ready to be executed.
You can either run the workflow manually or schedule it to run at a specific time of your choice.
For more information and an example on how to use the output of one PDF Workflow Action as the input of the next Action can be found in our blog Combining multiple Muhimbi PDF SharePoint Workflow Activities into a sequence.

Next steps

If you'd like to get started with PDF Converter for SharePoint we offer a free trial for both SharePoint Online and SharePoint On-premise deployments. We also provide fre support to help you intergrate our solutions into your SharePoint environment. If you have any questions please contact our support team who will be happy to help.

Additional Resources

Have a Question?
We’re Always Happy to Help.

© Muhimbi Ltd. 2008 - 2024
This website uses cookies to ensure you get the best experience. Learn more