dongzhi6463 2013-01-16 05:45
浏览 37
已采纳

wkhtmltopdf没有为Debian创建pdf

This is my PHP code which I am using to convert HTML file to pdf and then download pdf file from server.

wkhtmltopdf

$url = base_url().'invoices/'.$file_name.'.html';                    
exec("wkhtmltopdf-amd64 $url {$file_folder}{$file_name}.pdf");

header("Cache-Control: no-cache");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=$file_name.pdf");
header("Content-Type: application/pdf");
header("Content-Transfer-Encoding: binary");
$pdfFile = base_url().'invoices/'.$file_name.'.pdf';
readfile($pdfFile);

& after execute exec("wkhtmltopdf-amd64 $url {$file_folder}{$file_name}.pdf"); it does not create pdf file in the folder

It is working fine on Ubuntu but on Debian after download pdf, when open pdf Adob Reader says error please see the image.

I think the issue is due to exec() not working in Debian...!

enter image description here

wkhtmltopdf

  • 写回答

2条回答 默认 最新

  • douyi1341 2013-01-21 07:28
    关注

    For Debian I needed to install xvfb-run wkhtmltopdf

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥60 Python如何后台操作Vmwake虚拟机键鼠
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容