Hey Ian thanks lot for your previous help...I hope you could help me with this
AddPage();
$mpdf->debug = true;
$mpdf->useOnlyCoreFonts = true;
$mpdf->SetDisplayMode('fullwidth');
$mpdf->SetDisplayPreferences('FitWindow');
$mpdf->WriteHTML($varpdf);
$mpdf->Output('famada.pdf', 'F');
echo "PDF Created";
echo "";
unset($varpdf);
?>
The $varpdf contains all the html contents which I need for pdf. But now when I have to make pdf's of number of graphs I want to know how do I override the contents, cause even after using unset() I am getting this error
"Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 261900 bytes) in D:\wamp\www\WebModule\mpdf.php on line 14603."
As I have said before, mPDF is hungry in its use of memory, and there may be limit to what you can achieve. The only suggestion I can make is to break up the HTML code and pass it in chunks as this can reduce peak memory usage.
I'm lucky to have a very powerful server, so to avoid the memory limit error error, I run this line of code at the top of my PDF generation script:
ini_set("memory_limit","512M");
BE CAREFUL THOUGH! This could result in a low spec machine crashing or behaving strangely if you run out of RAM. I do this on a server with 16GB of ram. You have been warned
If you can consider using eAccelerator - www.eaccelerator.net. It is a byte code compiler which also caches your PHP scripts. This reduces the memory requirement significantly. I generate some pretty complex documents using mPDF. I have now started using eAccelerator and I find that my memory requirment has gone down by a factor of 8. It also helps to run compress.php to strip out the mPDF features that you are not going to use.
The problem is getting an eAccelerator binary that works on your installation. If you have a half decent host they probably provide eAccelerator as part of the package. If you are running a Windows server you will find a number of DLL builds at http://www.sitebuddy.com/PHP/Accelerators/eAccelerator_windows_binaries_builds. With some luck your version of PHP will be available.