Lines Matching defs:code
12 * @param string $code
17 public function __construct($code, $printRatio, $extended = false, $checksum = false, $quiet_zone_left = null, $quiet_zone_right = null)
19 $this->init($code, $printRatio, $extended, $checksum);
29 * @param string $code
36 private function init($code, $printRatio, $extended, $checksum)
85 $code = strtoupper($code);
90 $code = $this->encodeExt($code);
93 if ($code === false) {
94 throw new \Mpdf\Barcode\BarcodeException(sprintf('Invalid CODE39 barcode value "%s"', $code));
99 $checkdigit = $this->checksum($code);
100 $code .= $checkdigit;
103 $code = '*' . $code . '*';
105 $bararray = ['code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => []];
107 $clen = strlen($code);
109 $char = $code[$i];
112 throw new \Mpdf\Barcode\BarcodeException(sprintf('Invalid CODE39 barcode value "%s"', $code));
144 * @param string $code
147 protected function encodeExt($code)
185 $clen = strlen($code);
189 if (ord($code[$i]) > 127) {
190 throw new \Mpdf\Barcode\BarcodeException(sprintf('Invalid CODE39 barcode value "%s"', $code));
193 $code_ext .= $encode[$code[$i]];
202 * @param string $code
205 protected function checksum($code)
215 $clen = strlen($code);
218 $k = array_keys($chars, $code[$i]);