Power Automate: Create A PDF File From HTML [No Premium]

power automate Create A PDF File From HTML

Learn how to create a PDF file from HTML with Power Automate without any premium connectors.

Step by step: How to create PDF from HTML with Power automate

Power Automate Created PDF

Learn how to create a PDF file from HTML step by step.

  1. Create a flow with manual trigger

    power automate create instant flow

    Create instant flow

  2. Add a ‘Compose’ action

    Power Automate Add Compose Action

    Add Compose Step

  3. Copy the HTML into Compose

    Power Automate Copy HTML To Compose Inputs

    Paste HTML

  4. Add a ‘Create file’ action

    Power Automate Create File Action

    Create file

  5. Set ‘Create file’ Folder Path, File Name and File Content

    Power Automate Create File Setup

    Create HTML File configuration

  6. Add a ‘Convert file using path’ action

    Power Automate Convert File Using Path

    Convert file using path

  7. Configure ‘Convert file using path’ action’s File Path and set Target Type to PDF

    power automate pdf convert file

    Convert file using path configuration

  8. Add another ‘Create File’ action

    Power Automate Create File Action

    Create file action

  9. Set ‘Create file’ Folder Path, File Name and File Content

    power automate pdf file from html create pddf file

    Configuration of ‘Create file’

  10. Add a ‘Send an email (V2)’ action

    Power Automate Send an Email Action

    Send an email (V2)

  11. Finally send the PDF file via email

    Power Automate Send An Email Configuration

    Configuration ‘Send an email (V2)’

HTML for Copy and Paste

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<style>
    * {
        font-family: Arial;
        font-size: 11px;
    }
    th,td {
        padding:6px;
        text-align: start;
        vertical-align: text-top;
    }

    th{
        max-width: 100px;
        min-width: 100px;
    }
    td{
        max-width: 340px;
        min-width: 340px;
    }
    h3{
        font-size: 20px;
        font-weight: bolder;
        padding-bottom: 4px;
        margin-bottom: 0px;
    }
   td{
        background-color:#f3f3f3;
    }

</style>
 <h3>Sample PDF</h3>
<table>
    <tr>
        <th>First name </th>
        <td>John</td>
        <th>Last name</th>
        <td>Doe</td>
    </tr>
    <tr>
        <th>Age</th>
        <td>27</td>
        <th>Gender</th>
        <td>Male</td>
    </tr>
    <tr>
        <th>Country</th>
        <td>USA</td>
        <th>City</th>
        <td>New York</td>
    </tr>
</table>
</body>
</html>

6 thoughts on “Power Automate: Create A PDF File From HTML [No Premium]”

  1. Hi
    I tried the above-mentioned steps, I am able to create the pdf as attachment into the received email but getting an error while opening that PDF as:
    “Something went wrong
    Unable to open the file”

    Please guide me what is the possible solution for this.

    1. I too was receiving that error and found a solution. In step 9 above, the `File Content` field shows to use the dynamic content `Body`. However, when I used that, it said it was Blob Meta Data. And when opening the pdf in VSCode it was just a JSON object of the meta data, not the actual file contents. So, I changed the `File Content field` to the dynamic data called `File Content` in step 9 and in the attachment of the email, and this corrected the error.

Leave a Comment

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