English 中文(简体)
WKHTMLTPPDF WKHTMLTPDF WKHTMLTPDF 无返回任何返回
原标题:WKHTMLTOPDF returns nothing

I am trying to convert a html page to pdf using command-line convertor WKHTMLTOPDF. It does not return me anything and it does not throw any errors ether.

[root@s16271040 var]# grep -i amd /proc/cpuinfo
[root@s16271040 var]# grep -i intel /proc/cpuinfo
vendor_id       : GenuineIntel
model name      : Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
vendor_id       : GenuineIntel
model name      : Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
vendor_id       : GenuineIntel
model name      : Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
vendor_id       : GenuineIntel
model name      : Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
vendor_id       : GenuineIntel
model name      : Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
vendor_id       : GenuineIntel
model name      : Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
vendor_id       : GenuineIntel
model name      : Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
vendor_id       : GenuineIntel
model name      : Intel(R) Xeon(R) CPU E31270 @ 3.40GHz

[root@s16271040 bin]# ls -la | grep -i pdf
-rw-r--r--  1 root root    8224273 May 24  2010 wkhtmltopdf-0.9.9-static-i386.tar.bz2
-rwxrwxrwx  1 root root    8218920 May 24  2010 wkhtmltopdf-i386
-rwxrwxrwx  1 root   1000 11446024 Oct  2  2011 wkhtmltopdf-i386_11
-rw-r--r--  1 root root   11414685 Oct  2  2011 wkhtmltopdf-i386.tar.bz2

[root@s16271040 bin]# wkhtmltopdf-i386 http://google.com test.pdf
[root@s16271040 bin]# ls -la | grep -i test.pdf

The version I am trying is 0.9.9 taken from http://code.google.com/p/wkhtmltopdf/downloads/list I tried the latest one - 0.11.0. Still no success

如有任何帮助,将不胜感激

最佳回答

wkhtmltopdf 需要一个 x 实例, 可能由 xvfb 提供, 它没有真正的 x 服务器运行, 因为 < a href=" http:// ciaranmcnulty.com/blog/2009/04/converting- html- to- pdf- using- wkhtmltopdf " rel= “ no follow” 例如这里提到 。

如果这种联系今后会消失,比如:

xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf --dpi 200 --page-size A4 http://domain.tld/page.html /path/to/output.pdf
问题回答

您至少应该获得某种形式的输出。 至少是一个错误。 您正在使用哪个操作系统? 如果基于 Debian 的 app- get 安装 wkhtmltopdf 尝试安装 wkhtmltopdf, 如果您在服务器而不是桌面上, 那么以上答案是正确的, 您需要一个运行中的 X11 服务器或者 Xvfb 等类似服务器 。





相关问题
KornShell- Creating a fixed width text file

I need to create a simple fixed width text file in KornShell (ksh). My current attempt using printf to pad the string isn t working out very well. What s the shortest, cleanest way to create a fixed ...

unix find command

how to use the find command to find files/directories which are not matching the pattern. for eg: find <some options > -name "dontfile.txt" should give me output of all the find whose file ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

Case insensitive comparison of strings in shell script

The == operator is used to compare two strings in shell script. However, I want to compare two strings ignoring case, how can it be done? Is there any standard command for this?

1. 露台式照像

在Windows XP中,没有一时出现指挥时,是否有办法操作一种灰色文字? 我常常需要把“善待”(工作)与“灰色”同起来,即使我的文字没有产出,......

热门标签