Wicked pdf not rendering header/footer

爷,独闯天下 提交于 2019-12-05 10:33:40

Use a version of wkhtmltopdf built with patched qt, which properly works with footer and header.

$ wget http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
$ tar xf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
$ sudo mv wkhtmltox /usr/local/share/
$ sudo update-alternatives --install /usr/local/bin/wkhtmltopdf wkhtmltopdf /usr/local/share/wkhtmltox/bin/wkhtmltopdf 1005

check the version:

$ wkhtmltopdf --version

it should say:

wkhtmltopdf 0.12.4 (with patched qt)

test it:

$ wkhtmltopdf --footer-center 'footer' http://www.google.com google.pdf

you can also install the wkhtmltoimage:

$ sudo update-alternatives --install /usr/local/bin/wkhtmltoimage wkhtmltoimage /usr/local/share/wkhtmltox/bin/wkhtmltoimage 1005

you can use a script like this: wkhtmltox installer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!