I am trying to create hundreds of PDF files with TCPDF using a while loop. The problem is that it seems to create only the first one and then stops. I turned on error reporting and there is no error.
I basically get the data with:
ob_start();
while($row = mysqli_fetch_assoc($data)) {
$invoice_id = $row['invoice_id'];
require_once('tcpdf_include.php');
// create new PDF document
$pdf = new MYCUSTOMPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// All $pdf-> settings are here
// add a page
$pdf->AddPage();
$pdf->lastPage();
$pdf->Output('/path/to/'.$invoice_id.'.pdf', 'F');
echo "Generated ". $invoice_id."\n";
}
The .PDF gets generated fine, but it stops there. It doesn't continue with the next in the loop.
Anybody with TCPDF experience knows what is wrong? I can't figure it out and there is no error even with error_reporting(E_ALL);. Any help is greatly appreciated.
$data?) ;o) finally: are you certain that there's actually more than one row?