Wkhtmltopdf边距(顶部和底部)

Kwa*_*jes 9 linux pdf ubuntu margin wkhtmltopdf

我在a:Linux 3.2.0-24-generic#38-Ubuntu x86_64 GNU/Linux上使用wkhtmltopdf 0.10.0 rc2

我无法使用margin-top或创建PDF margin-bottom(没有错误)

我正在使用以下命令:

wkhtmotopdf -T 50 -B 50 http://google.com ./test.pdf
wkhtmotopdf --margin-top 50 --margin-bottom 50 page.html ./test.pdf
Run Code Online (Sandbox Code Playgroud)

当我尝试这个:

wkhtmotopdf -L 50 -R 50 -T 50 -B 50 page.html ./test.pdf
Run Code Online (Sandbox Code Playgroud)

左边和右边的边距完美(仍然没有边缘顶部或边缘底部).我转换的URL或页面无关紧要.

编辑:

看起来这是一个错误.对于仍然需要一些利润率/利润率最低的人.尝试使用header-html/footer-html功能:

刚刚意识到剪切问题是通过添加header-spacing和footer-spacing参数来修复的:

wkhtmotopdf -L 50 -R 50 -T 50 -B 50 http://google.com --header-html blank.html --header-spacing 5 --footer-html blank.html --footer-spacing 5 ./test.pdf