Odoo Help

1

How to get webkit reports pagination to not cut a line in half?

By
Dale E. Moore
on 4/16/13, 12:38 PM 12,770 views

webkit report pages that overflow to the next page cut a line of the report in half. The top half of the line appears on the first page and the bottom half of the line appears on the second page.

4
Paul Catinean
On 9/18/13, 7:46 AM

This is a very known webkit bug called the "page-break bug"

What essentially happens is that when the page-break the wkhtmltopdf library does not take the actual element and separate it on one page or the other it just prints the content and split the pages causing the effect you want to avoid

The solution for this is to place the iterative content (order lines, invoice lines) whatever you loop over and extends the report over several pages into a <div style="page-break-inside: avoid">

The css property "page-break-inside: avoid" works on divs and tables <table style="page-break-inside: avoid"> for what I've tested which I think have the common property of being "block elements"

So if you use tables to generate the report place the content as such <tr><td><div class="nosplit">${line.property}></div></td></tr>

Also make sure that the content in the header and footer is not larger than the actual margin you add (You can easily debug this by setting borders to the body in the header/footer and see if they are cut off).If the margins are not completly visible then just add margin until they are fully exposed to avoid content overshooting the header and overlapping with the mako

Hope this helps and anyone feel free to complete this answer and give feedback

Good luck!

Can you specify which version of wkhtmltopdf you use, and tell us if there are some news about the header repeating, Best Regards

Yug Faa
on 9/18/13, 9:57 AM

It doesn't matter which version it is, they all have this bug.The solution is in the Answer I gave which should prevent the page-break from hapening

Paul Catinean
on 9/18/13, 9:59 AM
0
Walid Baruni
On 7/21/14, 7:34 AM

Hi

This bug have been fixed in the latest version of wkhtmltopdf library. You can get it from here:

http://wkhtmltopdf.org/downloads.html

The new version also repeats the table header in each page, which is pretty good in sales orders and invoices that go 2 or more pages in length.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

4 follower(s)

Stats

Asked: 4/16/13, 12:38 PM
Seen: 12770 times
Last updated: 12/2/15, 9:24 AM