Sorry to resurrect this thread, but lolmann’s problem seems very similar to mine and I haven’t been able to find a solution after trolling through the forums and google.
I’ve used the dompdf_helper.php file and can generate around 10 to 15 pdf’s before I’m given the error:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 311296 bytes) in /home/xx/ci_system/helpers/dompdf/lib/class.pdf.php(2219) : eval()‘d code on line 1476
Each of the individual PDFs is very small, so I’m not sure why I’m using so much memory.
So to quote the second poster, “What can I do to make the PDF creation less of a memory sucker?”
// generate performance evals
$i = 0;
foreach ($evals as $eval) {
$eval['student_name'] = $first_name . " " . $last_name;
$performance_evals .= print_performance_eval($eval);
$this_eval = print_performance_eval($eval);
$i++;
$pe_filename = $first_name."_".$last_name."__".$i;
$pdf_data = pdf_create($this_eval, '', false);
write_file("./assets/pdf/{$pe_filename}.pdf", $pdf_data);
}
Thanks! - Rahul