How do I get WKHTMLTOPDF to execute via PHP?

后端 未结 7 1873
孤街浪徒
孤街浪徒 2020-11-29 00:28

This has been asked to some degree before but there are no solutions or accepted answers and I\'d like to try and be more comprehensive in my question so:

I\'m tryin

7条回答
  •  一向
    一向 (楼主)
    2020-11-29 01:16

    This worked for me as a way to pre-generate a PDF report then use a unique session ID to fetch it from the requesting page (of the same session).

    $cmd = "/usr/local/bin/wkhtmltopdf 'http://127.0.0.1/myApp/pdfReport.php?key=something' tmp_reports/report_".$_POST['sessionid'].".pdf";
    exec($cmd);
    

提交回复
热议问题