cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Deriooo
Level: Powered On

HTML page break convert to PDF

Hey everyone,

 

Wondering if you could help me please, I have a flow that converts HTML text to PDF and then saves the PDF file to OneDrive.

The html text is sent from PowerApps to flow, this is used for a company delivery ticket, the ticket and design all works correctly. The issue I am having is when multiple tickets are passed from PowerApps, the new ticket is not generating on to a new page, what I am trying to achieve is basically ticket 1 on page 1, ticket 2 on page 2 etc.

I have used the page-break-before and page-break-after in my html, I have also tried break-after, these work correctly in my html document but this does not work when the flow converts to PDF, the page breaks are removed.


I can use <br> on the end of my html to pad out the spacing at the end of the ticket, however this doesn't always work as depending on the data passed to the delivery ticket the height can change.

Does anyone have any experience in getting the page breaks to work when converting to PDF or any work around I can use instead? 

 

I have copied in the html below for reference.

Thanks in advance!


Deri


concat('<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 0.5px solid black;}
.newPageTop {
page-break-before:always;
}
.newPageBottom {
page-break-after:always;
}
p {break-before: always;
}

</style>
</head>
<body><p></p><h3 style= "text-align: center; color:#000080; font-family:tahoma; font-size: 12px;"> <img src="', variables('logoHeader'),'" style="width:350px; height:60px;"> <br> T:  <br> E: 
<br>
W: <br><img src="', variables('logoSocial'),'" style="width:60px; height:20px;"></h3>', items('Apply_to_each'), '<center><img src="', variables('creditLogo'), '" width ="120px" height="30px""></center></td></tr></table>

</body>
</html>')

 

1 REPLY 1
Super User
Super User

Re: HTML page break convert to PDF

HI @Deriooo 

 

I don't have much experience in this, but I did some digging and found the following articles:

https://powerusers.microsoft.com/t5/Building-Power-Apps/html-page-breaks-does-not-work-using-MS-Flow...

 

Also, I found this:

https://stackoverflow.com/questions/6235038/pagebreak-in-converting-html-to-doc-and-docx-fromat-php

(Try inserting the style directly in the <br>)

 

Hope this helps you

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (5,135)