I'm trying to paste an image onto a pdf. $img is a php generated PNG file. The image appears when echoed.
echo "<img src='".$img."'>";
sleep(5);
// initiate FPDI
$pdf = new FPDI();
$pdf->setPrintHeader(false);
// add a page
// set the sourcefile
$pdf->setSourceFile('reports/Report'.$r.'.pdf');
$tplIdx = $pdf->importPage(1);
$pdf->AddPage();
$pdf->useTemplate($tplIdx, 10, 10, 200);
$pdf->Image($img, 26, 57, 170, 134, 'PNG', '', '', true, 150, '', false, false, 1, false, false, false);
$filename = $_SERVER['DOCUMENT_ROOT']."pdf/test.pdf";
$pdf->Output($filename,'F');
There is no error log, and test.pdf is blank at the place where $img should be.
Do you know the reason for this error ?
thank you in advance :)