HTML 2 PDF and page break 

  

Hi,


I am using HTML2PDF to convert html page to pdf. I am facing issue in page break.

In my web page, I am using List Records to display multiple records and I want to break page on each item of List Records. I have already tried page-break-inside and page-break-always but no luck. In browser Print preview, it breaks with above css but in html2pdf it is not working


Thanks in advance.


Regards,

Sunil Mane

Hi Sunil,

Questions about Forge components can best be asked on the dedicated Forge forum for the component instead of the general Tech one (i.e. this one). It will get better attention there.

Hi Sunil Mane, 

Look this component 

Simple Reports With PDF ( https://www.outsystems.com/forge/component/1771/simple-reports-with-pdf/ ).

I think it'll help you.

Hello Sunil.


I have been through this same issue before, and in the past there was no support for these CSS properties in wkhtmltopdf (which is the library that this forge component uses). But it seems to be supported now, at least according to this stackoverflow post from 2015: http://stackoverflow.com/questions/13516534/how-to-avoid-page-break-inside-table-row-for-wkhtmltopdf

You might want to check if you have up-to-date binaries of wkhtmltopdf.exe (for that, use the administration of the HtmlToPdfConverter).

Also, you may want to try using --print-media-type in the OtherArgs input. The full list of options can be found here: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt