$pdf =& new FPDI();
// set the sourcefile
$pages=$pdf->setSourceFile($filename);
// import pages one after the other
for($i = 1; $i < $pages; $i ++) {
// add a page
//echo memory_get_usage() . "\n";
$pdf->AddPage();
$tplIdx = $pdf->importPage($i);
// use the imported page and place it at point 10,10 with a width of 100 mm
$pdf->useTemplate($tplIdx);
echo memory_get_usage();
// write text with link to www.fpdf.org website
$pdf->SetFont('Arial');
$pdf->SetTextColor(255,102,102);
$pdf->SetXY(15, 15); // X (cm), Y (cm)
$pdf->Write(0,$signature_text,'http://www.address.cc');
//$pdf->Write(0,'w w w . f p d f . o r g');
}
$pdf->Output('newpdf.pdf', 'D');
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
increase your php memory size to 32 and see if it works. to test if this is the case try to put this line at the top of your code
ini_set('memory_limit', '32M' );
or
ini_set('memory_limit', '64M' );