HTML to PDF CSS "page-break-before/break-before" not working!


I am using Aspose PDF for .NET version 11.3 to convert HTML to PDF.

I would like to have a page break in HTML. I have used CSS “page-break-before: always;” and also tried “break-before: page;”. I could see page break in HTML (print preview) but not in the converted PDF.

I do see lots of questions related to this in the forum but not with clear answer.



We have tested your scenario with the latest version 18.1 of Aspose.PDF for .NET API and it generates the PDF document with page breaks as we can view in the print preview.


Document document = new Document(@"C:\Pdf\test622\input.html", new HtmlLoadOptions());

This is the Zip of input and output files: (27.2 KB)