Dompdf: "Maximum execution time of 30 seconds exceeded"

I had similar issues with domPdf as well, and couldn't resolve them. I guess you could always stick an ini_set for max_execution_time in your controller if you're stuck.

Eventually I moved to MPDF and this works really well for me. It seems to be the most portable, and well maintained PHP HTML to PDF library that I've found.

I'm not sure I should post this as an answer or a comment, let me know if this should be a comment instead.


It happened to me and the problem was rather a small one.

Apart from increasing the timelimit, do check if your content is overflowing or not, I was setting paper size as A4, but when I changed it to A3, the page rendered correctly and hence didnt took long amount of time (for library to figure out the page overflow)

$dompdf = new DOMPDF();
$dompdf->set_paper('A3','landscape'); //Changed A4 to A3
$dompdf->load_html($html);
$dompdf->render();

I know this has been answered, but I'd just like to add, DOMPDF doesn't like nested tables

http://eureka.ykyuen.info/2011/04/29/php-dompdf-render-timeout-problem/