最佳答案
我一直在使用 什么在我的 linux 网络服务器上动态地将 html 转换成 pdf 文档。这个程序最初需要 X11或类似的 X 服务器才能正确运行,但是通过开发人员的许多请求,让这个程序在没有 GUI 的服务器上运行,我非常肯定它在 静态版本中运行一个虚拟 X 服务器。我一直在使用该程序的静态(独立)版本,它的工作非常好!我将把可执行文件放在一个文件夹中,然后运行:
./wkhtmltopdf file1.html file2.pdf
However I would like to install this program system-wide. I used the apt-get install wkhtmltopdf
(just installed yesterday) and since I am running on a 64 bit system, I also needed apt-get install ia32-libs
. After installation I can find the version like this:
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
Does anyone know how I can fix this? I guess this version is missing a virtual X server or something.