I am trying to generate bulk invoices (for printing) in the same PDF by using tcpdf library. The problem is that if there are too many (over 50 pages ) to generate the server will crash with this error.
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 72 bytes) in /home/user/public_html/lib/tcpdf/tcpdf.php on line 16680
So i can see that the max memory limit on my account is 335544320 bytes.
I tried using ini_set('memory_limit', '-1');
but it cannot pass 335544320 bytes. On my localhost is working OK because i have all the memory_limit available.
So the question is how can fix this in order to work. To see or download the PDF containing all the invoices. I was thinking if this cannot be done because of the memory problem, to save each PDF in a folder and then zip and download the folder.