How do I get WKHTMLTOPDF to execute via PHP?

后端 未结 7 1864
孤街浪徒
孤街浪徒 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

    To create a pdf from php (on linux) you must use a wrapper.

    $cmd = '/usr/bin/xvfb-run --server-args="-screen 0, 1920x1080x24" /usr/bin/wkhtmltopdf http://google.com /tmp/google.pdf';
    
    exec($cmd);
    

提交回复
热议问题