function UPC_A($pdf, $x, $y, $barcode, $h = 16, $w = 0.35) { Barcode($pdf, $x, $y, $barcode, $h, $w, 12); }
$pdf->Line(0.1875 + 2.625 + 0.125 + 2.625, 0, 0.1875 + 2.625 + 0.125 + 2.625, 11); $pdf->Line(0.1875 + 2.625 + 0.125 + 2.625 + 0.125, 0, 0.1875 + 2.625 + 0.125 + 2.625 + 0.125, 11); $pdf->Line(0.1875 + 2.625 + 0.125 + 2.625 + 0.125 + 2.625, 0, 0.1875 + 2.625 + 0.125 + 2.625 + 0.125 + 2.625, 11); } } # write the code $pdf->SetFont('Helvetica', ''); $pdf->SetFontSize($basefontsize); $pdf->SetTextColor($light); $width = $pdf->GetStringWidth($item['code']); $pdf->Text($bx + $label_width - $width - $vmargin, $by + $height - $vmargin, $item['code']); # write the barcode if ($item['barcode']) { foreach ($item['barcode'] as $code => $quantity) { if ($quantity == 1) { Barcode($pdf, $bx + $vmargin, $by + $height - $vmargin - $basefontsize / 72, $code, $basefontsize / 72, 1 / 72, strlen($code)); break; } } } # write the name $pdf->SetFontSize($size = $basefontsize * 2); $pdf->SetTextColor(0); $name = utf8_decode($item['name']); $width = $pdf->GetStringWidth($name); while ($width > $label_width - $vmargin * 2 && $size) { $pdf->SetFontSize(--$size); $width = $pdf->GetStringWidth($name); } $pdf->Text($bx + $vmargin, $by + $vmargin + $size / 72, $name); # write the price