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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Converting HTML to PDF...
Power Automate
Unanswered

Converting HTML to PDF Issue

(0) ShareShare
ReportReport
Posted on by 33

I have created a Flow that takes input from a PowerApp, converts it to a HTML file in OneDrive and then converts it to a PDF file and saves it as an attachment in a SharePoint list. All steps work ok. 

 

The issue I am having is that if I have code after inserting a table in the HTML, if there is any code after the table, the table and everthing after does not appear. If there is nothing after the table it displays correctly. 

 

I have taken out the variables and put in static code to ensure that the issue is not to do with the code that is getting passed through to it from PowerApps.

 

Wondering if this is a bug?

 

For example the following code works:

<body>

<h1>Heading</h1>

<table>

<tr>

<td></td>

</tr>

</table>

</body>

 

This fails to display the table and everything below the table:

<body>

<h1>Heading</h1>

<table>

<tr>

<td></td>

</tr>

</table>

<h2>Heading 2</h2>

</body>

Categories:
I have the same question (0)
  • tfhegdbn Profile Picture
    149 on at

    Hi ,

    Can you share the details of your Flow configuration?Perhaps your code breaks the level of the original Html tag. Make some of the content that should be displayed covered.

  • LukeB Profile Picture
    33 on at

    I have removed all steps so that there is only a trigger and a "One Drive - Create File" step. It is configured as:

    Snippet.jpg

     

    The code I have is:

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
     <title>Document</title>
    </head>
    
    <body>
     <span>
     <h1>Report</h1>
     <p>
     Test Report
     </p>
     <table width=100%>
     <tr>
     <td>
     <strong>Title 1</strong>
     </td>
     <td>
     Some Text
     </td>
     </tr>
     <tr>
     <td>
     <strong>Title 2</strong>
     </td>
     <td>
     Some more text
     </td>
     </tr>
     </table>
     <h1>Another Heading</h1>
     </span>
    </body>
    </html>

    With the line in red, when you open the file in One Drive you get:

    WithHeading.jpg

    When you take the line out you get:

    WithoutHeading.jpg

    The files display as expected when you download from One Drive and open in a browser. If you convert to PDF however the PDF looks like how the file displays when opened in One Drive, not the browser.

     

    To meet my requirements I need to have multiple tables, headings and paragraphs. I can get away with sending as an email from PowerApps (which works fine) and not convert to PDF if this does not work but...

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Try removing the span tags.

  • VitorPereira Profile Picture
    2 on at

    Did you ever get a workaround for this?

     


    @LukeB wrote:

    I have removed all steps so that there is only a trigger and a "One Drive - Create File" step. It is configured as:

    Snippet.jpg

     

    The code I have is:

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
     <title>Document</title>
    </head>
    
    <body>
     <span>
     <h1>Report</h1>
     <p>
     Test Report
     </p>
     <table width=100%>
     <tr>
     <td>
     <strong>Title 1</strong>
     </td>
     <td>
     Some Text
     </td>
     </tr>
     <tr>
     <td>
     <strong>Title 2</strong>
     </td>
     <td>
     Some more text
     </td>
     </tr>
     </table>
     <h1>Another Heading</h1>
     </span>
    </body>
    </html>

    With the line in red, when you open the file in One Drive you get:

    WithHeading.jpg

    When you take the line out you get:

    WithoutHeading.jpg

    The files display as expected when you download from One Drive and open in a browser. If you convert to PDF however the PDF looks like how the file displays when opened in One Drive, not the browser.

     

    To meet my requirements I need to have multiple tables, headings and paragraphs. I can get away with sending as an email from PowerApps (which works fine) and not convert to PDF if this does not work but...


     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 641

#2
Vish WR Profile Picture

Vish WR 640

#3
Haque Profile Picture

Haque 495

Last 30 days Overall leaderboard