Lines Matching defs:code

7  * EAN13: European Article Numbering international retail product code
8 * UPC-A: Universal product code seen on almost all retail products in the USA and Canada
15 * @param string $code
22 public function __construct($code, $length, $leftMargin, $rightMargin, $xDim, $barHeight)
24 $this->init($code, $length);
33 * @param string $code
36 private function init($code, $length)
38 if (preg_match('/[\D]+/', $code)) {
39 throw new \Mpdf\Barcode\BarcodeException(sprintf('Invalid EAN UPC barcode value "%s"', $code));
52 $code = str_pad($code, $dataLength, '0', STR_PAD_LEFT);
53 $codeLength = strlen($code);
58 $sum_a += $code[$i];
66 $sum_b += ($code[$i]);
80 $code .= $r;
82 } elseif ($r !== (int) $code[$dataLength]) {
84 throw new \Mpdf\Barcode\BarcodeException(sprintf('Invalid EAN UPC barcode value "%s"', $code));
89 $code = '0' . $code;
95 $tmp = substr($code, 4, 3);
96 $prodCode = (int) substr($code, 7, 5); // product code
99 // Manufacturer code ends in 000, 100, or 200
100 $upceCode = substr($code, 2, 2) . substr($code, 9, 3) . substr($code, 4, 1);
105 $tmp = substr($code, 5, 2);
107 // Manufacturer code ends in 00
108 $upceCode = substr($code, 2, 3) . substr($code, 10, 2) . '3';
113 $tmp = substr($code, 6, 1);
115 // Manufacturer code ends in 0
116 $upceCode = substr($code, 2, 4) . substr($code, 11, 1) . '4';
121 // Manufacturer code does not end in zero
122 $upceCode = substr($code, 2, 5) . substr($code, 11, 1);
216 $bararray = ['code' => $upceCode, 'maxw' => 0, 'maxh' => 1, 'bcode' => []];
217 $p = $upceParities[$code[1]][$r];
223 $bararray = ['code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => []];
227 $seq .= $codes['A'][$code[$i]];
230 $p = $parities[$code[0]];
232 $seq .= $codes[$p[$i - 1]][$code[$i]];
237 $seq .= $codes['C'][$code[(int) $i]];