ubuntu server18.04下安装使用wkhtmltopdf

自从不再折腾odoo后,很久没有使用wkhtmltopdf了,在ubuntu server18.04下使用wkhtmltopdf会提示Cloud not connect to any X display的错误,可以通过xvfb执行wkhtmltopdf。首先安装wkhtmltopdf及xvfb:

sudo apt-get install xvfb

sudo apt-get install wkhtmltopdf

然后再执行xvfb-run wkhtmltopdf $source $destination命令就可以生成pdf文件。

Leave a Reply

您的电子邮箱地址不会被公开。 必填项已用 * 标注

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>