wkhtmltopdf page-break-after have whitespace

萝らか妹 提交于 2019-12-03 20:18:27
Ace Suares user1266770

I am using version wkhtmltopdf 0.12.0

For me, page breaks ONLY work with --print-media-type. Without it, page break protection for images works, but not page-break-after or before.

I had to make a special css file for print media to get it work.

Setting the paper size to 'A3' or using the 'overflow: visible' didn't make any difference.

Also see WKHTMLTOPDF with pdfkit on Rails ignoring table page breaks

The solution i found was to set the page size to A3, which make all the clever printerfriendly stuff work.

I use this WKHTMLTOPDF call:

/usr/local/bin/wkhtmltopdf --page-size 'A3' --encoding 'UTF-8' '<LINK TO PAGE>' '/tmp/PDFX6BefV'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!