我一直在使用wkthmltopdf在我的linux web服务器上即时将html转换为pdf文档.该程序最初需要X11或类似的X服务器才能正常运行,但是由于开发人员要求在没有GUI的服务器上运行该程序,我很确定它在静态版本中运行虚拟X服务器.我一直在使用程序的静态(独立)版本,它工作得很好!我将可执行文件放在一个文件夹中,然后运行:
./wkhtmltopdf file1.html file2.pdf
Run Code Online (Sandbox Code Playgroud)
但是我想在系统范围内安装这个程序.我使用了apt-get install wkhtmltopdf(昨天安装),因为我在64位系统上运行,我也需要apt-get install ia32-libs.安装后我可以找到这样的版本:
wkhtmltopdf --version
Run Code Online (Sandbox Code Playgroud)
输出:
Name:
wkhtmltopdf 0.9.9
License:
Copyright (C) 2008,2009 Wkhtmltopdf Authors.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO
WARRANTY, to the extent permitted by law.
Authors:
Written by Jakob Truelsen. Patches by Mário Silva, Benoit Garret and Emmanuel
Bouthenot.
Run Code Online (Sandbox Code Playgroud)
现在当我尝试运行通过aptitude安装的程序时,我收到以下错误:
wkhtmltopdf: cannot connect to …Run Code Online (Sandbox Code Playgroud)