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...!