Hey there,

I am using zend_pdf to generate one big pdf-file with ten thousands of
pages. Now there is a problem when generating that amount of pages, that the
memory exhausts... Does somebody know how to handle this? Is it possibly
possible to do something like this for every page that is generated?

btw code below doesn't work correctly (because I don't know how to render a
single page in zend_pdf)...

<?php
$pdf = new Zend_Pdf();

// SEND DOWNLOAD HEADERS
header('Content-Description: File Transfer');
header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1
header('Pragma: public');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
// force download dialog
header('Content-Type: application/force-download');
header('Content-Type: application/octet-stream', false);
header('Content-Type: application/download', false);
header('Content-Type: application/pdf', false);
// use the Content-Disposition header to supply a recommended filename
header('Content-Disposition: attachment;
filename="'.utf8_decode($name).'";');
header('Content-Transfer-Encoding: binary');


// START LOOPING
for($i=0;$i<=10000;$i++){

$pdf->pages[] = ($page = $this->pdf->newPage('A4'));

// DO TEXT STUFF

echo $pdf->render();
ob_flush(); // flush it so its get send to browser
flush();
unset($pdf->pages[] );
}
?>

The idea is basicly the same as a script for downloading large files with
PHP (link: http://nl3.php.net/manual/en/function.readfile.php#54295)... It
this possible for zend_pdf?

Can anybody help with this?
-- 
View this message in context: 
http://www.nabble.com/zend_pdf-generating-large-files-tp23738425p23738425.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to