将html转换为pdf

Raj*_*eev 4 javascript css linux pdf

我正在尝试将html转换为来自linux的pdf,我也必须在web APP中使用这个,请告诉我有什么工具可用于此.请让我知道任何其他工具

到目前为止我已经尝试过

    html2ps htmlfilename > a.ps
    ps2pdf a.ps > a.pdf
Run Code Online (Sandbox Code Playgroud)

但上面没有转换图像而忽略了css.我的开发环境是linux(RHEL5)

我也试过http://www.webupd8.org/2009/11/convert-html-to-pdf-linux.html我收到此错误

  [root@localhost bin]# ./wkhtmltopdf www.example.com a.pdf
  ./wkhtmltopdf: error while loading shared libraries: libQtWebKit.so.4: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)

Pis*_*3.0 5

你是在正确的道路上:wkhtmltopdf是最简单的方法.请注意,存储库中的代码可能已过时(不确定此程序包的最新版本); 您可能需要从源代码编译它,或者获取静态链接的版本(这是很大的,但已经包含了QT库和其他依赖项).

此外,在您的情况下,您可能只是错过了一个库 - 安装libqt4-webkit-dev可能会在这里诀窍.