In this guide, you’ll learn how to automatically print documents to PDF in SharePoint using a Power Automate flow and our [Document Converter][]. If you’re looking to automatically convert documents to PDF, visit our SharePoint PDF conversion guide.
Supported document types:
-
Word
-
Excel
-
PowerPoint
-
HTML / URLs
-
SharePoint pages
-
SharePoint lists
-
And more
This example takes you through printing a Word document to PDF.
1: Creating a New Flow in Power Automate
Create a new flow and use the When an item is created or modified trigger for SharePoint Online. Fill out the URL for the site address and select the relevant SharePoint list from the dropdown menu.
2: Converting to PDF
Insert Muhimbi’s Convert document action and fill it out as shown in the screenshot displayed below. You’ll need to substitute the Source file name and Source file content fields with suitable values.
3: Creating a File
Insert a Create file action to write the converted file back to SharePoint Online or your desired destination.
4: Publishing the Workflow
Publish the workflow and upload an MS Word or MS Excel file. After a few seconds, the flow will trigger and a PDF file will be printed and saved in the target location.
Troubleshooting/Caveats
HTML isn’t the best format for print or PDF conversion purposes. Depending on your exact needs and source material, you may need to experiment with various available settings. If you have any questions or require assistance, please feel free to contact us.
Please consider the following when using Power Automate:
-
Modern views — In SharePoint Online, it’s possible to display lists and libraries in modern or classic mode. Modern view is undergoing constant change (by Microsoft), and some modern view pages will convert fine, while others don’t. As a result, we currently only support the conversion of pages displayed in classic view.
-
Multi-factor authentication (MFA) — An increasing number of SharePoint Online/Office 365 environments are secured using MFA. Although this is a positive development, it gets in the way of automated systems, including our HTML converter. If your environment uses MFA, create an app password for HTML conversions, or disable MFA on your HTML conversion account.
-
HTML conversion option isn’t displayed — The option to convert the current page to PDF is only available in classic SharePoint pages. Modern pages currently don’t provide the ability to extend the personal actions menu. As soon as Microsoft makes this functionality available, we’ll add it.
-
PDF layout doesn’t match — By default, the page being converted is optimized for print/PDF output. If you prefer for a PDF to look exactly like what’s displayed onscreen, including user interface elements, set the Media Type to Screen in the HTML conversion configuration screen.
-
User-modified content isn’t converted — The converter doesn’t have knowledge about the information currently displayed in the user’s browser (e.g. size of the browser window, or custom data entered but not yet submitted to the server). The converter always requests a fresh copy of the URL and converts that information to PDF.
-
User-specific information is missing — HTML conversion is carried out in the context of the configured user account, though the system isn’t aware of the user carrying out the HTML conversion. Don’t specify accounts that display more information than what users need to have access to.
We recently released the Muhimbi Document Converter Xtension for Nintex Automation Cloud. You can download it here or learn more about available Muhimbi deployments for Nintex on our product page.
Nintex Forms provides a quick and easy way to create surveys, questionnaires, and more to collect responses from different people.
However, the completed forms aren’t easily portable, i.e. you can’t send a form and guarantee the “look and feel” remains the same.
In this guide, you’ll learn how to create a simple list containing a Nintex form and then associate Power Automate to convert the form to a PDF once the form is submitted. Then, you’ll learn how to batch-print those documents.
How to Create a Nintex Form
You can create a sample Nintex form by performing the following steps:
-
Navigate to your MS SharePoint site collection, create a new custom list, and name it Nintex Form Demo.
-
Once the list has been created, add a few columns based on your requirements.
-
Once the list has been configured, navigate to the list and click the Nintex Forms icon.
-
Click OK for the popup. The Nintex Form Demo opens in Nintex Forms.
Note: In the page configuration section, the Save button has been automatically added to the form, and it’ll work right out of the box.
-
Click Publish, and your form will be ready to be used in the MS SharePoint list.
Prerequisites
First, ensure all prerequisites are in place:
-
A full or free trial subscription of [Muhimbi Document Converter for Power Automate][].
-
Appropriate privileges to create Power Automate flows.
-
Working knowledge of both Nintex Forms and Power Automate.
-
Access to a high-speed printer to print large volumes of documents quickly.
Using Power Automate to Convert Nintex Forms to PDF
On a high level, the workflow will look like what’s shown below.
To start building your flow, follow the steps outlined below.
-
Log in to Microsoft Flow and select the My Flows tab. Navigate to New Flow > Automated cloud flow.
-
Enter a meaningful name for the flow, select the When an item is created MS SharePoint trigger, and click Create.
-
In the trigger, specify the path to the SharePoint Online list to monitor the new list item.
-
Add the Muhimbi Convert HTML to PDF action to the flow canvas and configure it with the details below.
-
In the Source URL or HTML field, navigate to the Add Dynamic Content line and choose Link to item from the Get file properties action.
-
In the Page orientation field, select the appropriate option. Depending on the content and layout of the page, Portrait may be best.
-
In the Media type field, select the Print option from the dropdown menu. This automatically helps strip out most of the MS SharePoint user interface.
-
In the Authentication type field, select SharePoint Online from the dropdown menu.
-
You’ll need to enter the correct User name and Password to be authenticated with the SharePoint Online authentication that you selected in the authentication field above.
-
In the Conversion delay field, enter a delay of 10,000 (in milliseconds, so 10 seconds). This delay will give the page time to load before it’s converted.
Note: To pass credentials directly in the Power Automate action and in plain text without disclosing the credentials, you can create a Secret in Azure and pass it along.
-
Add the MS SharePoint Create File action to the flow canvas and configure it with the details below:
-
In the Site Address field, choose the correct site address from the dropdown menu.
-
Select the correct Folder Path where the converted PDF should be created.
-
Give a meaningful File Name to the created PDF, but make sure you remember to add the
.pdf
extension after the file name and to make the file name unique, or multiple runs of the flow will overwrite the same file. -
Select the Processed file content option to populate the File Content field.
-
With everything in place, create a list item, and after a few seconds, a PDF will be placed in the output folder.
-
Periodically copy a batch of converted PDF files from SharePoint to your local drive using the Library’s Actions / Open with Windows Explorer menu.
-
Select the batch of PDF files on your local system, right-click one of the files, and select the Print option.