I am using wkhtmltopdf 0.12.5 (with patched qt)
to print in PDF format some HTML and CSS code (actually, I am using Odoo 15 which uses wkhtmltopdf
).
The problem is for example, when I print an invoice with a big description which does not fit in a single page. The result is that the <th>
inside the <thead>
tag is overlapped by the content of the (big) <tr>
inside the <tbody>
tag at the second page.
This issue is mentioned in many posts:
- https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1524
- https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2141
- https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2367
- Wicked_pdf avoid page-break-inside not working
- wkhtmltopdf repeating thead headers overlapping content
- Table headers overlapping content on second page when converting to PDF with wkhtmltopdf
However, none of the answers worked for me. I think I've forgotten none of them to try. This is my current attempt to fix the problem:
thead {
display: table-header-group !important;
}
tfoot {
display: table-row-group !important;
}
table, tr, td, th, tbody, thead, tfoot, td div {
page-break-inside: avoid !important;
}
.page {
overflow-x: visible !important;
}
But the result is exactly the same as always. I've checked that the CSS file is correctly loaded and updated since I've put some colors and they worked, but not the problem with the overlapping.
My question is if somebody developing for Odoo has resolved this problem.