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

Hello,

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.

Thanks.

@RR_ASPOSE,

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.

C#

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

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