Sonia1091 / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

PDF creation stops after 5-6 PDF files (instead of 18) #504

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. have a loop
2. buffer the output of another php and save in variable in the loop
2. create a pdf in the loop

What is the expected output? What do you see instead?
It should save all (in this case) 18 invoices of my clients on the server. The 
script stops right before it renders the output (4) on the 4th, 5th or 6th 
loop. No error message. If I substitute the output buffered variable with 
"YES", it works fine - so it's not the output buffering itself.
You can find the result also on 
http://www.circlerotterdam.nl/php/invoices/invoice_checkusers.php

What version of dompdf are you using? What version of PHP? On what
operating system?
newest dompdf 0.6.6 beta 3 - php 5.2.14 - linux

Please provide the HTML source code you want to convert, or any additional
information.

Original issue reported on code.google.com by lgg.wett...@gmail.com on 12 Jun 2012 at 5:39

Attachments:

GoogleCodeExporter commented 9 years ago
I would guess you're maybe exceeding the memory allocation allowed by PHP. It's 
hard to say without knowing why the script stops. Does PHP throw any errors?

It's also possible you're running into a bug due to your document structure. 
But we can't tell that unless we see the actual HTML that dompdf is trying to 
render.

One thing you can try is destroying the dompdf object after use. It may help in 
freeing up some memory. 0.6.0 does have some level of object destruction 
cleanup. Unfortunately you may not see a lot of improvement unless you're using 
PHP 5.3.x.

For PHP 5.2.x what we've found in the past with using dompdf in a loop was that 
you should put dompdf into an external script which you call using exec(). Your 
memory usage and rendering speed are typically better using this method.

Original comment by eclecticgeek on 12 Jun 2012 at 6:46

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Using exec() was the trick. Thank you.

Original comment by lgg.wett...@gmail.com on 13 Jun 2012 at 1:38

GoogleCodeExporter commented 9 years ago
Glad that worked.

Marking as invalid because this isn't technically a bug in dompdf, it's more 
due to deficiencies in garbage collection in PHP. There are some improvements 
we can make, particularly with PHP 5.3 installations. I don't know that we'll 
be able to fully address the memory load issues for the next release, but we 
are working on it.

Original comment by eclecticgeek on 13 Jun 2012 at 3:17

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:16