We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

HTML PDF Print with page-break-inside

Hi,

The css propertly ‘‘page-break-inside:avoid’’ is not working when converting HTML to PDF using Aspose HTML . The other css properties works. Are there alternatives for this or is this going to get fixed,

Thanks

@sathsaranim

Could you please ZIP and attach your input HTML, problematic and expected output PDF files here for testing? We will investigate the issue and provide you more information on it.

The sample html and css file is attached along with the expected output. The expected output is the pdf generated output via browser print option. But with aspose html library, below styles does not seem to apply. page break sample.zip (250.9 KB)

  .comm-section {
    page-break-inside: avoid; 

}
.commentary-block {
    page-break-inside: avoid;
}

}

@sathsaranim

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as HTMLNET-3618. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@sathsaranim

We analyzed the provided document and found an issue that occurs during the processing of the “page-break-inside” property. We are going to fix it in the nearest future. As an alternative solution, you can rename this property to its newer version, “break-inside”, then the document will be converted as expected.

We have attached the modified CSS and PDF files in this post for your kind reference.
trow-css.zip (818 Bytes)
22.1.pdf (62.4 KB)