Timeout issue generate wkhtmltopdf in symfony 2.4 knpSnappy bundle

5.2k Views Asked by At

When i download pdf using knpSnappy bundle , sometimes it's working proper and sometimes it's not working.

It generates errors like this:

The process "/usr/local/bin/wkhtmltopdf --margin-bottom '0' --margin-left '0' --margin-right '0' --margin-top '0' --page-size 'A4' --disable-javascript --load-error-handling 'ignore' '/tmp/knp_snappy59521f8e31bad9.75401982.html' '/tmp/knp_snappy59521f8e31c3d6.47962749.pdf'" exceeded the timeout of 60 seconds.

Please help me to resolve this issue.

Thanks

1

There are 1 best solutions below

0
On

Try to set a different timeout after creating a snappy instance like so:

$snappy = new Pdf('/usr/local/bin/wkhtmltopdf.sh');

$snappy->setTimeout(600);  // 600 seconds