Files
MYSOPHAL/lib/tcpdf/templates/article_qr_all.php
2025-11-09 10:02:18 +01:00

50 lines
1.8 KiB
PHP

<?php
ob_Start();
require_once('tcpdf_include.php');
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetMargins(5, 5, 5, true);
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->AddPage();
$pdf->SetFont('helvetica', '', 8.5);
$var1 = '<table style="border-collapse-bottom:separate; border-spacing:5px;">';
$detail = array();
$line_br_counter = 0;
for($i=0;$i < count($arry); $i++){
$ligne = '<tr>
<th align="center" width="58" height="58" style="border-right:1px solid black; border-left:1px solid black; border-top:1px solid black; border-bottom:1px solid black;"><img src="'.implode($arry[$i]).'" width="58" height="58"></th>
<th align="center" width="188" height="58" style="border-right:1px solid black; border-left:1px solid black; border-top:1px solid black; border-bottom:1px solid black;"><h3>'.key($arry[$i]).'</h3></th>
</tr>';
array_push($detail,$ligne);
$line_br_counter ++;
if($line_br_counter == 5){
$line_br_counter = 0;
$var2 = implode("",$detail);
$content = $var1.$var2.'</table>';
$pdf->writeHTML($content, true, false, false, false, '');
$pdf->AddPage();
unset($var2);
unset($content);
unset($detail);
$detail = array();
}else if($i == count($arry) - 1){
$var2 = implode("",$detail);
$content = $var1.$var2.'</table>';
$pdf->writeHTML($content, true, false, false, false, '');
unset($var2);
unset($content);
unset($detail);
$detail = array();
}
}
//$pdf->Image($filename, 10, 10, 15, 15, 'PNG', '', '', true, 150, '', false, false, 1, false, false, false);
//$pdf->SetXY(25, 10);
//$pdf->Cell(50, 15, $libartc, 1, 0, 'L', 0, '', 0, true,'C', 'C');
$pdf->Output($codeartc.'.pdf', 'I');