You can temporarily increase the memory size limit:
$memory_berfore = ini_get('memory_limit'); // in your php.ini // New Limit ini_set('memory_limit','256M'); //128M, 256M, 512M, 1024M,... (X*2M) ... your code (creating large PDF) ... // Older Limit ini_set('memory_limit',$memory_berfore);
Edit:
As stated in pgampe , you can put -1 instead of '256M' in my example so that there is no memory limit.
doydoy44
source share