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 Apps / Converting HTML to PDF...
Power Apps
Answered

Converting HTML to PDF - some content not converting

(0) ShareShare
ReportReport
Posted on by 38

Hello - the html text shown below in red is making it through a power automate process to the html stage OK but the conversion to pdf (One drive for Business - convert to pdf) doesn't seem to be picking it up. I have attached the two outputs (html and pdf) to show the missing content. Any advice gratefully received. Cheers. Thom

 


// This is HTML that sends to flow to generate the PDF file.
"<html>" & "<head>
<H1>ME Detail report: " & ddPlanName_1.Selected.Result & " - " & ddDate.Selected.Value & "</H1>
<p>" & HtmlExecutiveSumm.HtmlText & " </p><br>
<p>" & HtmlKPIDecline.HtmlText & " </p><br>
<p>" & HtmlSocCult.HtmlText & " </p>
<style>
a { color: blue; }
body { text-align: centre; }
h1 { color: green; }
table.one { border-collapse: collapse; border-spacing: 10px; }
table.two { border-collapse: collapse; border-spacing: 10px; }
table, td, th { border: 1px solid; border-color: lightgray; vertical-align: text-top}
td.content{ padding-left: 5px; padding-right: 5px; }
span { color: white; padding-top: 2px; padding-bottom: 2px; padding-left: 8px; padding-right: 8px; font-size: 80%; }
</style>
</head>" & "<body>" &
// Strategies - First Table etc

Capture_PDF.PNG
Capture_HTML.PNG
Categories:
  • WarrenBelz Profile Picture
    156,576 Most Valuable Professional on at

    Hi @ThenewThom ,

    The OneDrive PDF converter is not a "full blown" HTML resolver and things like CSS Styles often do not translate. I keep my HTML on these to fairly simple basic tags (table structure and colours, font bold, italic, underline etc) which generally do the job I need.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • ThenewThom Profile Picture
    38 on at

    Hi Warren - thanks for responding. That's the part that's difficult to follow - the style applying to the tables works perfectly. It's the basic stuff (the <p> tags) that isn't going through. Cheers, Thom

  • WarrenBelz Profile Picture
    156,576 Most Valuable Professional on at

    Hi @ThenewThom ,

    The other thing I forgot to mention is that the OneDrive converter is far less forgiving on structure inconsistencies such as the lack of closing tags. I have tested code that resolves perfectly in a Power Apps HTML control, but if the tags are not strictly correct gets unexpected results in the PDF like yours.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • ThenewThom Profile Picture
    38 on at

    Thanks Warren - it was a problem with the label I used - the conversion handled .text with the html as a resolved output (rich text style) but I was feeding it html that included the filtering codes etc. Oh well, is working now

  • Verified answer
    WarrenBelz Profile Picture
    156,576 Most Valuable Professional on at

    Hi @ThenewThom ,

    So this is now solved?

  • micross Profile Picture
    30 on at

    Is there a list somewhere of common html styling that doesn't covert well in powerflow?

  • efeewfew Profile Picture
    302 on at

    I can't find one, have you found one yet?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard