jsreport / jsreport-core

The minimalist jsreport rendering core
GNU Lesser General Public License v3.0
85 stars 24 forks source link

wkhtmltopdf page break / table header issue #25

Closed denizalpaslan closed 6 years ago

denizalpaslan commented 6 years ago

Hi,

I'm converting html to pdf using wkhtmltopdf recipe and jsrender engine using the following options:

wkhtmltopdf:{ printMediaType: true, marginTop: 25, marginBottom: 16, marginLeft: 15, marginRight: 17, footer: "some footer" }

and also footer-spacing: 5 as a global option.

It seems to work fine but in some cases, it poorly breaks the tables into the next page. For example, in the second page, there are a small space between table header and the rows. Or sometimes there is only the table header in the second page (the last data row is rendered on page 1 but the header repeats on page 2 anyway).

My CSS for page breaks is like :

table { page-break-inside:auto; } tr { page-break-inside:avoid; page-break-after:auto } thead { display:table-header-group } tfoot { display:table-footer-group }

A sample screenshot is attached. Any idea?

page_break

pofider commented 6 years ago

This is not a jsreport issue but the wkhtmltopdf issue. You may try to ask the question in wkhtmltopdf repository with provided input html, wkhtmltopdf switches and expected results. https://github.com/wkhtmltopdf/wkhtmltopdf/issues

Unfortunately we can't help you with this here.