cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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>')

 

3 REPLIES 3
Highlighted
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

Deriooo
Level: Powered On

Re: HTML page break convert to PDF

Hi Manuel,

 

Thanks for your reply and suggestions, apologies for the late reply. 

 

I have tried the suggestions you sent over, unfortunately still not working as expected, so I'm assuming Flow can't support this function at the moment. Thanks for your help on this anyway!

 

Thanks,

 

Deri 

Super User
Super User

Re: HTML page break convert to PDF

Hi Deri,

Can you please share the complete HTML your sending to conversion? we can't validate the HTML with the contained variables.

Thanks J

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,017)