Zend PDF Memory Management

I am trying to create a large PDF file using Zend \ PDF. But since Zend stores the data in the object, at some point it displays the error message "memory exhausted."

Does anyone know how to manage memory while creating large PDF files ???

+7
php zend-framework zend-framework2
source share
1 answer

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.

+2
source share

All Articles