我正在使用wkhtmltopdf 0.10.0 rc2:Linux 3.2.0-24-generic#38 –Ubuntu x86_64 GNU / Linux
我无法使用margin-top或margin-bottom创buildPDF(无错误)
我正在使用下面的命令:
wkhtmotopdf -T 50 -B 50 http://google.com ./test.pdf wkhtmotopdf --margin-top 50 --margin-bottom 50 page.html ./test.pdf
当我尝试这个:
wkhtmotopdf -L 50 -R 50 -T 50 -B 50 page.html ./test.pdf
左右保证金完美(仍然没有保证金或保证金)。 我转换哪个url或网页并不重要。
看起来这是一个错误。 对于那些仍然需要一些保证金的人来说, 尝试使用header-html / footer-htmlfunction:
刚才意识到剪辑问题是通过添加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
访问https://code.google.com/p/wkhtmltopdf/issues/detail?id=957