2

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:

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.

forvas
  • 9,801
  • 7
  • 62
  • 158

1 Answers1

0

If you are using bootstrap you can try removing "table-responsive" class. That works for me.

https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3195#issuecomment-840018767

Vineeth Vijayan
  • 1,215
  • 1
  • 21
  • 33