Create any size of PDF in max 2 mins using PHP
I was stuck with the task . In which I want to create pdf of 30 pages within 30 seconds. The other problem was that pdf file contains too many nested tables, tr, tds because of them it was taking too much time and our server says goodbye for the task. I have tried several ways like node js, pdf dompdf, mpdf nothing helps me :(
Then i used wkhtmltopdf plugin for this task. i found it very fast. as compared to other plugins, and it is very simple also. it works only in single command
$cmd = '/usr/bin/xvfb-run --server-args="-screen 0, 1920x1080x24" /usr/bin/wkhtmltopdf http://google.com /tmp/google.pdf';
shell_exec($cmd);
You have to manually install “xvfb-run” and “wkhtmltopdf” manually to your server on which you want to run. That’s all you have to done now run the command in your PHP file and enjoy the fastest pdf creation method.
Feel free to ask me any kind of questions !