wkhtmltopdf fails with --footer-center argument

跟風遠走 提交于 2019-12-11 12:16:43

问题


Im trying to insert text into the footer with wkhtmltopdf.

wkhtmltopdf ../input.html ../output.pdf --footer-center="My Text"

But it just gives me the error

Unknown long argument --footer-center=My Text

I have tried many ways

wkhtmltopdf ../input.html ../output.pdf --footer-center=My Text
wkhtmltopdf --footer-center="My Text" ../input.html ../output.pdf
wkhtmltopdf ../input.html --footer-center="My Text" ../output.pdf

But all results in

Unknown long argument --footer-center=My Text

Im using wkhtmltopdf 0.12.1 (with patched qt)

And man wkhtmltopdf describes the --footer-center argument

And of course input.html already exists in the parent directory, and everything works perfect if I dont add the --footer-center argument


回答1:


Instead of = the parameter value has to be separated by (a space).

wkhtmltopdf --footer-center "My Text" ../input.html ../output.pdf

And with multiple

wkhtmltopdf --footer-center "My Text" --footer-left "Left content" ../input.html ../output.pdf


来源:https://stackoverflow.com/questions/28746794/wkhtmltopdf-fails-with-footer-center-argument

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