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 Apps
Unanswered

HTML to PDF tables

(0) ShareShare
ReportReport
Posted on by 6

Hi all,

 

I have looked into converting HTML into PDF, as I have data that are entered througout an app which shall be put in various tables, and then exported and sent as an email with the PDF attached.

 

I have searched the internet and this community for a solution, but I have not found anything yet that explains my problems. Many similar things, but not very clear solutions. So, I have made a version in HTML. I can my see the html-file looks great in the chrome browser, and I can print the html to PDF in the browser and it comes out exactly like I want it.

I have no problems creating a basic table in html with some styling and it showes up pretty good on the pdf from Powerapps. But my tables are somewhat big. The tables should fit nicely inside the pdf - but my experience is that the tables are overlapping on the created pdf, or the borders are showing double on some cells. Even height gets messed up on random rows. Some html disappears, like <textarea> but I can live with that. Even though I have gone trought the code and also played around with various tables to see if I can see what provokes Powerapps to slip on the pdf, I can not find a good explanation.

 

I checked out some of the pay-ware versions for converting html to pdf. They look nice, but I created my tables and forms based on a PDF that already exists and need to have that little bit of extra possibility of customzation.  I`d like my newly created PDF to look like the original as much as possible.


Can anyone share their experiences with creating complex pdf`s forms from html/css and what type of expressions and how much styling you can get away with? Are there any secrets to what Powerapps "likes", like div`s perhaps?

Categories:
  • alrezac Profile Picture
    Microsoft Employee on at

    Hi,

     

    I've never done PDF conversion within PowerApps however I have experimented around with the OneDrive PDF conversion function within Flow. While using that action in Flow I tend to have very hit or miss results. Sometimes it comes out looking perfect and sometimes it introduces some weird formatting. I think this is because it uses the same settings every time during the conversion process and doesn't inherit anything from the source file so no matter what changes you make it will always convert it in the same way, so adjusting height/width's, page sizes and file properties and vastly change how a conversion turns out. It is probably very similar for how PowerApps does things.

     

    Regards,

     

    Alex

     

    -------

     

    Community Support Team _ Alex Rezac
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • jKell Profile Picture
    82 on at

    @microsoft_agent  I was making some PDF from HTML using the flow and OneDrive: 

    Shane Young Video: https://www.youtube.com/watch?v=bfXV_GXc_JM

     

    I would generate the HTML to send to the flow using an HTML Text box and tables.

     

    I was encountering issue with my Tables being split across the page breaks.  You can add CSS at the top of your HTML page to control some aspects of PDF conversion.  You can control alot when it comes to sizing, color etc, But I wasn't able to make a perfect PDF.  The code that helped me the most to avoid page breaks was:

    <style>
    table { page-break-inside:avoid;}
    </style>

     

    Hope that helps a little 

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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard