One of my clients asked me to create a PDF certificate after a learner completes a course. The requirement was to pull the learner’s name, course title, Score, and completion date from a SharePoint list and then create a PDF.
To meet this requirement, I created an HTML template that dynamically inserted these details and then converted the HTML into a PDF, all without using any premium connectors.
In this Power Automate, I will show you how to convert HTML to PDF using Power Automate without using any premium connector.
Convert HTML to PDF Using Power Automate
First, I created a SharePoint List named Course Completion with the below column and data types:
| Columns | Data Types |
|---|---|
| Name (Title) | Single line of text |
| Course Name | Single line of text |
| Score | Number |
| Date | Date and time |

Also, I already created the HTML script. Check the script below:
<div style="width: 550px; height: 600px; padding: 20px; text-align: center; border: 10px solid #787878; margin: auto;">
<table style="width: 100%;">
<tr>
<td style="width: 5%; text-align: center;">
<img src="https://your-logo-url.com/logo.png" alt="Company Logo" width="100" height="100">
</td>
</tr>
</table>
<h1>Certificate of Completion</h1>
<table style="width: 100%;">
<tr>
<td style="text-align: center;">
<p>
This is to certify that <strong>[Name]</strong> has successfully completed the course <strong>[CourseName]</strong> with a score of <strong>[Score]%</strong>.
</p>
<p>
Date of Completion: <strong>[Date]</strong>
</p>
</td>
</tr>
</table>
<table style="margin-top: 50px; width: 100%;">
<tr>
<td style="width: 50%; text-align: center;">
<img src="https://Instructor's Signature.png" alt="Instructor's Signature" width="100" height="100">
<p>_____________________________</p>
<p>Instructor's Signature</p>
</td>
<td style="width: 50%; text-align: center;">
<img src="https://Authorized Signature" alt="Authorized Signature" width="100" height="100">
<p>_____________________________</p>
<p>Authorized Signature</p>
</td>
</tr>
</table>
</div>
You might be wondering about the HTML boilerplate and CSS. Adding these can sometimes cause issues when converting to PDF. To avoid problems, use simple tags like <table> instead to create your HTML.
Now, follow these steps to add SharePoint values to the HTML and convert the HTML to PDF:
Add SharePoint List value to HTML using Power Automate
1. Create an automated cloud flow. Give the flow name and select the trigger When an item is created. Also, provide the Site Address and List Name.

2. We need to store the HTML script in the flow. To do this, I add an Initialize variable action and set below parameters:
- Name: Give a name to identify quickly. I give it varPdfTemplate
- Type: String from dropdown.
- Value: you HTML script.

3. Next, in the HTML script, I need to specify the keys we want to replace, such as Name, CourseName, Score, etc.. These will be replaced with values from the SharePoint list. To do this, I added a ‘Compose‘ action and provided the keys and values in JSON format. Check the screenshot below.

Now that our key-value pairs are set, we must replace them in the HTML script using the ‘Parse JSON‘ action. You must provide a sample schema to use the ‘Parse JSON’ action. To obtain this schema, save the flow and run it once. Then copy the ‘Compose’ action output.

4. Then edit the flow and Add a Parse JSON action. Also, provide the below parameter:
- Content: Provide the dynamic content output of the compose action.
- Schema: click Use Sample payload to generate schema, past the ‘Compose’ action output, then click Done.

5. Next, we need to replace the key with a value. I put the formula below in the expression to do this in the create a compose action.
replace(variables('varPdfTemplate'),concat('[',items('For_each')['Key'],']'),items('For_each')['Value'])
It will add for each action automatically.
This expression replaces a template’s specific placeholder(like [Name]) with a new value.
- variables(‘varPdfTemplate’): This is the name of the Initialize variable.
- concat(‘[‘,items(‘For_each’)[‘Key’],’]’): The placeholder in the template (e.g., [Name]).
- items(‘For_each’)[‘Value’]: The value to replace the placeholder.
6. Inside each action, add a set variable action and provide the parameters like Name as varPdfTemplate from the drop-down and Value as the output of the compose action, where we put the replace function.

Convert HTML to PDF using Power Automate.
Now that our HTML is complete, we need to convert it to a PDF. To do this, follow the below steps:
1. In the above flow, add a create file action in OneDrive for business. Then, provide the folder path, file name, and file content from the dynamic content.

2. Now, we need to convert that HTML file to pdf. For this, I add a convert file action and provide the parameters below
- File: Provide Id from the create file dynamic content
- Target Type: Select the PDF from the drop-down.

At this point, our PDF file is created in OneDrive. Where you store it depends on your preference. In my case, I want to store it in a SharePoint library.
So, I added a create file action from the SharePoint connector using the below parameter:
- Site Address: Provide which site you want to store.
- Folder Path: Provide Where you wish to store.
- File Name: Provide file name. You can give a different name, but I want the same name as onedrive.
- File Content: Provide the File content from dynamic content.

Lastly, add an action that deletes the Onedrive pdf file. To do this, add a delete file action from OneDrive for business. Then, provide an ID from dynamic content.

Now save the flow and test it manually. To do this, go to the SharePoint List and put the item on the SharePoint list.

A PDF file will be created in the SharePoint library when the flow runs successfully.

However, the images are not converted here. To do this, go to OneDrive, create a folder, and put the required image.

Then, edit the flow and get the image using the Get file content action. I use three images here, so I use Get file content three times.

Then, open the script variable where you store the HTML script. In the side src, add the expression, give dataUri (the file content of the get file content), and then click the add button to add the expression.

Then, save the flow, go to the SharePoint list, and add an item.

A PDF file will be created in the SharePoint library when the flow runs successfully.

This way, you can convert PDFs from HTML without using the Premium Connector in Power Automate.
I hope you follow all the steps to convert PDFs from HTML. If you have any doubts, you can freely ask in the comment box.
Also, you may like some more Power Automate tutorials:
- Power Apps vs Power Automate
- Get SharePoint Choice Values in Power Automate
- Calculate the Last Working Day Of a Month Using Power Automate
- Convert Word Files to PDF Using Power Automate
- Convert PDF to Base64 Using Power Automate
- Convert SharePoint list item to PDF using Power Automate
- Create PDF from Excel using Power Automate
- Create PDF from Microsoft Forms via Power Automate

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.