web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate Html Co...
Power Automate
Unanswered

Power Automate Html Convert to PDF

(1) ShareShare
ReportReport
Posted on by 108

Hi Everyone, I am trying to create a pdf from html document.

Everything is fine with HTML but when I am converting the html to PDF I am not getting the pdf as expected.
there are unnecessary spaces in borders and there are double borders in some tables.

 

is there any instructions to create such html so that pdf will be good? Please Help

@RezaDorrani

@Pstork1 @tom_riha @ScottShearer @abm 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    How are you setting things like borders in the HTML? Are you using CSS?  The built-in converter is somewhat limited in its support for custom CSS formatting of tables.  That may be what is causing he issue.  The only real solution for that is to use a third party connector/action that has a better feature set.  But we will need more information on the HTML you are using before we can really tell if that is the cause.

  • Dipak_Shaw Profile Picture
    108 on at

    I am using CSS for borders and also I am using the Border-collapse css but its not collapsing properly.

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    As I mentioned there is certain CSS that is not respected by the built-in PDF conversion.  In my case it was page breaks.  The only option then is to use one of the third party connectors to do the conversion. I've had good luck with Encodian.  They have a free license that can be used to explore the possibities.  I would try their connector and see if you get the results you want.  If you do you'll either need to use a third party converter or modify your table styling to supported CSS.

  • Verified answer
    Dipak_Shaw Profile Picture
    108 on at

    The issue was that I was using multiple tables and appending them one by one but I found that using colspan property in td tag we can create multiple columns in different rows in a single table and single table won't cause any css issue.

    Thanks

  • Dhruv100322 Profile Picture
    23 on at

    Hi @Pstork1 ,

     

    I am facing similar issue. Can you please help?

    https://powerusers.microsoft.com/t5/General-Power-Automate/Converting-from-HTML-to-PDF-returns-nothing/td-p/1554290

  • McPowerPlatform Profile Picture
    44 on at

    Depending of the Document you are going to format, the best experience I had was using DIV's, keep in mind that Power Automate supports inline CSS so let me add you some code with a table with sample data: you can add this in the flow as a compose step, let me know how this works for you

    <div id="table" STYLE="display: table;">
    <div style="display: table-caption; padding: 0.5em; border: 1px solid #000;">Table Head with DivsS</div>
    <div style="display: table-row; ">
    <div style="display: table-cell; padding: 0.5em; border: 1px solid; ">Data 1</div><div style="display: table-cell; padding: 0.5em; border: 1px solid; ">Data2</div><div style="display: table-cell; padding: 0.5em; border: 1px solid;">Data3</div>
    </div>
    <div style="display: table-row; ">
    <div style="display: table-cell; padding: 0.5em; border: 1px solid; " >Data 4</div><div style="display: table-cell; padding: 0.5em; border: 1px solid; ">Data5</div><div style="display: table-cell; padding: 0.5em; border: 1px solid; " > Data6</div>
    </div>
    <div style="display: table-row; ">
    <div style="display: table-cell; padding: 0.5em; border: 1px solid; " >Data 7</div><div style="display: table-cell; padding: 0.5em; border: 1px solid; " >Data 8</div><div style="display: table-cell; padding: 0.5em; border: 1px solid; ">Data 9</div>
    </div>
    </div>

  • jbushawgerber98 Profile Picture
    5 on at

    What are you using to convert the HTML to PDF? Adobe has an option but it's premium.

  • jbushawgerber98 Profile Picture
    5 on at

    Does anyone know how to fix the conversion of the html file to PDF from destroying my HTML table?

     

    The HTML file displays fine, but the resulting PDF has a mashed up HTML Table that is not readable.

     

    jbushawgerber98_0-1670400475360.jpeg

    jbushawgerber98_1-1670400492050.jpeg

     

     

  • McPowerPlatform Profile Picture
    44 on at

    Depending of the Document you are going to format, the best experience I had was using DIV's, keep in mind that Power Automate supports inline CSS so let me add you some code with a table with sample data: you can add this in the flow as a compose step, let me know how this works for you

    <div id="table" STYLE="display: table;">
    <div style="display: table-caption; padding: 0.5em; border: 1px solid #000;">Table Head with DivsS</div>
    <div style="display: table-row; ">
    <div style="display: table-cell; padding: 0.5em; border: 1px solid; ">Data 1</div><div style="display: table-cell; padding: 0.5em; border: 1px solid; ">Data2</div><div style="display: table-cell; padding: 0.5em; border: 1px solid;">Data3</div>
    </div>
    <div style="display: table-row; ">
    <div style="display: table-cell; padding: 0.5em; border: 1px solid; " >Data 4</div><div style="display: table-cell; padding: 0.5em; border: 1px solid; ">Data5</div><div style="display: table-cell; padding: 0.5em; border: 1px solid; " > Data6</div>
    </div>
    <div style="display: table-row; ">
    <div style="display: table-cell; padding: 0.5em; border: 1px solid; " >Data 7</div><div style="display: table-cell; padding: 0.5em; border: 1px solid; " >Data 8</div><div style="display: table-cell; padding: 0.5em; border: 1px solid; ">Data 9</div>
    </div>
    </div>

  • Dlegal Profile Picture
    7 on at

    Thanks for posting this. This is a very good baseline to work from to build more advanced layouts and I would recommend anyone looking to avoid a premium connector to start with what you have provided and go from there. I only wish I found your response sooner.  As a result of further discovery (or pain depending on one's perspective) I was able to build out the following form/report. You can put together something a bit more elegant but at the cost of some sanity. 😄

     

    Sample layoutSample layoutPage 2Page 2

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard