How to Merge Excel and Word Documents as PDFs in Power Automate
Converting Excel and Word (DOCX) to PDF means we can combine content created in both applications into a single, cohesive file.
Instead of manually exporting either file type as a PDF and handling our merge process within a PDF reader, we can, instead, handle the entire process in one Power Automate flow.
Convert and merge PDFs in one step
We can do so using the Cloudmersive Document Conversion connector. We can simply use two Get file content actions within a Scope control and then merge those results of those actions downstream in our flow.
We’ll walk through a quick example of that now.
Create an Instant cloud flow
Since we’re only merging two files, we’ll select the option to create an Instant cloud flow with a manual trigger.
Create a Scope control
On the flow diagram page, we’ll start by adding a Scope control action to our flow. This will neatly contain the file-retrieval portion of our flow design.
Retrieve Excel and Word files in a parallel process
Within our Scope control, we’ll add two parallel (SharePoint or OneDrive) Get file content actions. One will retrieve our Excel document, and the other will retrieve our Word document (note that both example documents I’m using in this video are random demo files).
Convert both documents to PDF simultaneously
We’ll now add one Cloudmersive PDF conversion action beneath each of our Get file content actions.
To find the action we need, we’ll search for Cloudmersive connectors in the Power Automate library, locate the Cloudmersive Document Conversion connector (with the green logo), and click “See more” to view the actions list.
Once on the actions list, we’ll search for an action titled Convert Document to PDF. This action can convert dozens of common file formats to PDF, and it does so at high fidelity by first autodetecting the input file format.
After we select this action the first time, we’ll need to create our Cloudmersive connection. We’ll authorize our connection with a free Cloudmersive API key (the same type of API key I’m using in this walkthrough), which we can get by creating a free account on the Cloudmersive website. Once we’ve created our connection, it’ll save for future uses.
We’ll now configure each Convert Document to PDF action by passing in file bytes from the preceding Get file content step. The file name parameter doesn’t need the actual file name — we can enter any name we ant.
Merge PDFs outside of the Scope control
Moving outside our Scope control, we’ll add one final Cloudmersive Document Conversion connector action into our flow.
This time, we’ll add an action called Merge Two PDF Files Together.
As the name indicates, this action merges two sets of PDF file bytes into a single PDF document.
We’ll configure this action as shown in the below screenshot, once again creating random name strings for both (file name) parameters.
Create the merged PDF and store it in SharePoint (or OneDrive)
To wrap up our flow, we’ll now add a Create file action.
We’ll use this action to write our merged PDF result to another SharePoint (or OneDrive, if we’re using OneDrive files instead) folder.
Save and test the flow
Now we’ll save and test our flow to generate our new PDF document.
We’ll find our merged file in the SharePoint (or OneDrive) folder we selected.
We can page through this file to check all the right content is there — and we’re all done!
Conclusion
In this walkthrough, we learned how to merge Excel and Word documents as PDFs in the same flow using the Scope control & two Cloudmersive Document Conversion connector actions. We can use this exact flow design for dozens of additional content types — including PowerPoints, Open Document files (ODT, ODS, etc.), and dozens of common image formats.