jesusjsc

Linux中wkhtmltopdf问题记录
# Linux中wkhtmltopdf问题记录 --- ## could not connect to...
扫描右侧二维码阅读全文
07
2019/06

Linux中wkhtmltopdf问题记录

Linux中wkhtmltopdf问题记录


could not connect to display 问题解决

  1. 安装wkhtmltopdf

    apt install wkhtmltopdf
  2. 试着运行,出现如下错误

    [email protected]:~# wkhtmltopdf www.baidu.com baidu.pdf
    QXcbConnection: Could not connect to display 
    Aborted (core dumped)
    
  3. 可以如下解决:

    xvfb-run wkhtmltopdf

    在此之前,需要先安装xvfb,使用命令:apt install xvfb

参见:http://unix.stackexchange.com/questions/192642/wkhtmltopdf-qxcbconnection-could-not-connect-to-display

无法显示中文字体问题

windows下的SimSun.ttf字体文件(或者到网上下载),拷贝到linux下的/usr/share/fonts/目录下,即可解决中文字体显示问题。

帮助文档

wkhtmltopdf -H
Last modification:May 29th, 2019 at 11:08 am
If you think my article is useful to you, please feel free to appreciate

Leave a Comment