Create documents from template and convert to PDF with one action in Power Automate
Plumsail Documents "Create document from template" actions got a new parameter for PDF conversion.
Spending hours manually adding sets of images into a single document?.. Doesn't sound like a fun thing to do! And suggested solutions often involve creating complicated workflows, which can get pretty overwhelming. So, what's the alternative?
We wrote this article to show you an easier way to create PDF documents with multiple images in Power Automate using the Plumsail Documents connector.
Contents
We'll use a Word template to create a PDF document with multiple images. The logic behind the approach is to use a picture formatter wrapped in a table cell with no borders.
You can also add dynamic text to each of the dynamic images. As an example, let's add a couple of pictures of buildings along with their descriptions.
You'll be able to add any data you like, collected from any other source.
To demonstrate the approach, we will be creating a DOCX inspection report, but this approach will also work for Excel XLSX and PowerPoint PPTX documents. You can download the inspection report template here.
We'll create an automated cloud flow that will trigger upon a new Plumsail Web Form submission. Our form features an attachments field that allows you to attach images as part of your submission.
You can use any other trigger to get the data to populate the template, or you can enter the data manually.
We will store our template to create a PDF with multiple images in a SharePoint document library and bring it into the flow using the 'Get file content' action. In our case it will be the DOCX inspection report template we mentioned earlier.
Next, we'll add the 'Create document from DOCX template' action from the Plumsail Documents connector. It will populate the template with the data and images from the form submission, and convert it to PDF for us to get the PDF document with multiple images.
Insert the file content into the 'Template file' field, and enter the data in JSON format into the 'Template data' field. Then, set the document output type to 'PDF' to receive the resulting document as a PDF file with multiple images.
Hint: Form submissions return pictures as blob URLs. You can send these blob URLs straight to your template without any additional processing. Alternatively, you can also insert your pictures as base64.
We'll export the output document to a SharePoint library using the 'Create file' action:
We made filename dynamic using dynamic values received from the form response.
All set! 🎉 Take a look at how the file turned out:
Hopefully, this has helped you solve your problem with automatically adding multiple images into your documents. If you have any questions, feel free to drop us a line at support@plumsail.com.
Sign up for a one-month free trial if you’re new to Plumsail Documents.