Page breaks in html conversion

Hello,

I’m having some issues with page breaks in html to pdf conversion. I’ve attached the HTML in question, and the PDF output for reference.

The goal here is to avoid having page breaks inside of each section.
I’ve used another HTML -> PDF converter with this same HTML and had it work as expected. Trying to figure out what I need to modify in the HTML in order for it to work using Aspose.

From doing some research on this forum I’ve learned that putting “page-break-inside:avoid” on divs won’t work due to how Word does things, so I’ve put it on the tables as well. But as can be seen in the output, the “Balance Sheet Worksheet” section is still split across pages.

PageBreakTestReport.zip (80.7 KB)

@Donnager,

Thanks for your inquiry. Please note that Aspose.Words mimics the behavior of MS Word. Could you please ZIP and attach your expected output PDF and code example that you are using to convert HTML to PDF here for testing? We will investigate the issue and provide you more information on it.

I’ve attached a (simplified) code example, the output it produces, and the desired output

AsposePDFExample2.zip (330.1 KB)

@Donnager,

Thanks for sharing the detail. Please note that Aspose.Words mimics the behavior of MS Word. If you open your HTML in MS Word, you will get the same output. In your case, we suggest you please insert one of the following tag in your HTML where you want to break the page. Hope this helps you.

<div style=“page-break-before:always;”> </div>
<p style=“page-break-before:always;”> </p>