1

Good morning, trying to produce, through a loop in php, plus pdf, finding a problem: it is only generated one.

Any suggestions?
for ( $i = 0; $i < 5; $i++ ) { ob_start(); include("./template_pdf.php"); $perc = "........"; $content = ob_get_clean(); try { $html2pdf = new HTML2PDF ( 'P', 'A4', 'it', true, 'UTF-8', 5 ); $html2pdf->pdf->SetDisplayMode('fullpage'); $html2pdf->writeHTML ( $content, isset ( $_GET['vuehtml'] ) ); $html2pdf->Output( $perc, 'F'); } catch ( HTML2PDF_exception $e ) { echo $e; } }

2

Hi,

Are you sure that $perc is different in the loop ?
If it's not, you always crush the same file...

Try something like following perhaps :
$perc = "file_".$i.".pdf";