dongzhi6463
dongzhi6463
2013-01-16 05:45

wkhtmltopdf没有为Debian创建pdf

  • debian
  • wkhtmltopdf
  • php

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条回答

为你推荐