【发布时间】:2012-03-25 03:59:55
【问题描述】:
我一直在使用wkthmltopdf 在我的 linux Web 服务器上即时将 html 转换为 pdf 文档。该程序最初需要 X11 或类似的 X 服务器才能正确运行,但通过开发人员的许多请求,使其在没有 GUI 的服务器上运行,我很确定它在 static version 中运行虚拟 X 服务器。我一直在使用该程序的静态(独立)版本,效果很好!我会将可执行文件放在一个文件夹中,然后运行:
./wkhtmltopdf file1.html file2.pdf
但是我想在系统范围内安装这个程序。我使用了apt-get install wkhtmltopdf(昨天刚安装),因为我在64位系统上运行,我还需要apt-get install ia32-libs。安装后我可以找到这样的版本:
wkhtmltopdf --version
输出:
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.
现在当我尝试运行通过 aptitude 安装的程序时,我收到以下错误:
wkhtmltopdf: cannot connect to X server
有谁知道我该如何解决这个问题?我猜这个版本缺少虚拟 X 服务器什么的。
【问题讨论】:
标签: wkhtmltopdf xserver