Generate a PDF in Power Automate without premium subscription

I needed to generate a PDF in a Power Automate flow, without premium subscriptions.

Using the Word actions was not an option because they are premium.

Premium Word actions in Power Automate

After thinking a little bit, I found out I could achieve generating a PDF by using a combination of following actions:

  • Compose
  • Create file (OneDrive)
  • Convert file (OneDrive)

Building the PDF generation flow

To achieve the generated PDF, I followed these steps:

  1. Write HTML code, with parameters in it
  2. Create a HTML file
  3. Convert the HTML file to a PDF file

An example of how your HTML could look like:

HTML structure to convert to PDF

After composing your HTML structure with all necessary parameters, you can create the HTML file:

Create HTML file with the OneDrive connector

After generating the HTML file, you can convert it to a PDF file:

Convert the HTML file to a PDF file with the OneDrive connector

Finally, you can create the PDF file:

Create the actual PDF file with the OneDrive “Create file” action

Currently, there is no other way than using the OneDrive actions to generate a PDF without premium or without paying.

The generated PDF contains everything you defined in your HTML structure:

Generated PDF in OneDrive

If you want to pay, you can use the Word actions, or buy a subscription from one of the following companies that have created custom actions for Power Automate.

  • Encodian
  • Plumsail Documents
  • Plumsail SP
  • PDF Blocks
  • Muhimbi PDF

If you define a service account as run-only user, you can generate all files in the OneDrive of that service account. You can for example create a specific folder and keep all HTML and PDF files in that folder. Make sure to generate dynamic HTML and PDF files to avoid duplicate file names.

Define a run-only user in the properties of the flow
Define a run-only user to keep all generated files in the OneDrive of a service account

The complete flow looks like this:

2 comments

  1. Is it possible to generate a PDF of more than one page?

Leave a Reply

Your email address will not be published. Required fields are marked *