CloudConvert html to docx page breaks

453 Views Asked by At

I'm using CloudConvert.com to convert an HTML report in my ASP.Net MVC site into a Docx file. It works fine except that I can't figure out how to get the resulting Docx to use the page breaks from the HTML. Things I've tried:

<div style='page-break-after: always;'></div>

<div style='page-break-after: always;'>&nbsp;</div>

<div style='page-break-after: always;'>
  My content
</div>

<section style='page-break-after: always;'>
  My content
</section>

All of those result in a page break when printing in the browser but none of them seem to have any impact on the docx created by CloudConvert.com. The documentation on CloudConvert leaves a lot to be desired when it comes to specific conversions like this.

Does anyone know if there's a way to tell CloudConvert to insert a page break?

1

There are 1 best solutions below

0
On

Try to use page-break-after on <br> tags instead:

<p>My content page 1</p>
<br style="page-break-before: always" />       
<p>My content page 2</p>