Lines Matching refs:code
7 * Compact numeric code, widely used in industry, air cargo
14 * @param string $code
19 public function __construct($code, $topBottomMargin, $printRatio, $checksum = false, $quiet_zone_left = null, $quiet_zone_right = null)
21 $this->init($code, $printRatio, $checksum);
31 * @param string $code
35 private function init($code, $printRatio, $checksum)
55 $checkdigit = $this->checksum($code);
56 $code .= $checkdigit;
58 if ((strlen($code) % 2) != 0) {
59 // add leading zero if code-length is odd
60 $code = '0' . $code;
63 $code = 'AA' . strtolower($code) . 'ZA';
65 $bararray = ['code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => []];
67 $clen = strlen($code);
69 $charBar = $code[$i];
70 $charSpace = $code[$i + 1];
73 throw new \Mpdf\Barcode\BarcodeException(sprintf('Invalid I25 barcode value "%s"', $code));
108 * @param string $code
111 private function checksum($code)
113 $len = strlen($code);
116 $sum += $code[$i];
120 $sum += ($code[$i]);