Consistently (meaning every time) I try to load a relatively large amount of HTML related to a client form into dompdf. I get either the subject error message or, occasionally, some other error. If I comment out the code for any one of what would be 9 pages in a PDF document, it works.
I've had the same problem in the past with variable length reports (this is a form that is always 9 pages) once a certain indeterminate critical mass of data is reached. Other posts I've seen related to this issue always include follow up comments insisting that the original poster provide the HTML. I tried to do that but it far exceeds the limit allowed.
To reduce the amount of HTML would result in HTML that dompdf would have no problem rendering, so I'm not sure how to proceed to get a resolution for this. I could provide a link to the page but it would require a userid & password for access and the resulting page would include information that is not for public consumption.
If there is no help to be had here can anyone suggest another forum where I could get help?
Here are a few specifics about the HTML that I can list that might be of help in diagnosing the problem:
- It's built almost entirely using HTML tables.
- None of the tables span multiple pages.
- There are no textarea controls.
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/
Here set time limit which in seconds. Set -1 for unlimited time limit. set_time_limit(500);
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)