Reputation: 53606
I am using FPDF.
I need to write to the disk every 10 pages or so, otherwise, memory gets exhausted.
How would I do that?
I tried calling the output method ('filename.pdf','F'); in a loop, this does not work.
Any idea how it should look like?
Upvotes: 0
Views: 258
Reputation: 6275
You'll need to look at the source of FPDF. I'm using TFPDF which I believe is a derivate work of FPDF, but the functions should be the same.
There is one function in particular _out($s)
function _out($s)
{
// Add a line to the document
if($this->state==2)
$this->pages[$this->page] .= $s."\n";
else
$this->buffer .= $s."\n";
}
Instead of appending to a buffer as they do in both cases... just fwrite to an open file descriptor of your choice.
Upvotes: 1