mPDF uses a lot of memory on the server. If you get an error message that you have exceeded your memory limits, try the following:
It is more efficient in very long documents to process the HTML code in small chunks rather than as one large HTML stringuseini_set("memory_limit","128M") or similar at the top of your script to allocate more memorygenerate a smallermpdf.php file.
Memory can become exhausted rapidly when running PHP 5.3.x on Windows. I believe this may be a bug in the Windows version of PHP. A script that exhausts 256 MB memory on Windows may only use 18 MB when run on Linux. It appears to happen most often (or exclusively) when using tables.
So if you are only using Windows in a test environment and use Linux for production, you should consider setting the memory limit to maximum on Windows e.g.ini_set("memory_limit","-1").
Small changes to your code e.g. the CSS applied to table elements can have dramatic, but unpredictable effects onthe memory usage. For example changing an attribute on a table cell to a css style.
Otherwise you will need to refer to the tips above, especiallysimpleTables orpackTabledata
One user has reported this problem disappearing when updating from 5.3.8 to PHP 5.3.10, so this may be a bug that is fixed?