Using FPDF to print barcodes in table, but last row prints after table, how to fix this?

  fpdf, mysql, php

output here

I am printing barcodes in table using getX() and getY(). but after the
table, at the end of page, the barcode is still printing. how can i
stop this problem and only print in rows.

$pdf->SetWidths(array(100,17,75,94));
$q="select * FROM pack where bogie_type_id_='$type' order by activity * 1 ";
$statement = $connect->prepare($q);
$statement->execute();
$result = $statement->fetchAll();
$pdf->SetFont('Arial','',12);

foreach ($result as $row) {
$desc=$row['a_description'];


 $pdf->Code39($pdf->GetX()+3, $pdf->GetY()+3, '%'.$row['activity'].' START',1,10);
 $pdf->Code39($pdf->GetX()+200, $pdf->GetY()+3, '%'.$row['activity'].' END',1,10);
    $pdf->Row(array('',$row['activity'],$desc,''));


}

Source: Ask PHP

LEAVE A COMMENT