92 $mode = explode(
',',
$type);
93 $qrtype = strtoupper($mode[0]);
96 require_once(dirname(__FILE__).
'/qrcode.php');
97 if (!isset($mode[1]) OR (!in_array($mode[1],array(
'L',
'M',
'Q',
'H')))) {
100 $qrcode =
new QRcode($code, strtoupper($mode[1]));
101 $this->barcode_array = $qrcode->getBarcodeArray();
105 require_once(dirname(__FILE__).
'/pdf417.php');
106 if (!isset($mode[1]) OR ($mode[1] ===
'')) {
109 $aspectratio = floatval($mode[1]);
111 if (!isset($mode[2]) OR ($mode[2] ===
'')) {
114 $ecl = intval($mode[2]);
118 if (isset($mode[3]) AND ($mode[3] !==
'') AND isset($mode[4]) AND ($mode[4] !==
'') AND isset($mode[5]) AND ($mode[5] !==
'')) {
119 $macro[
'segment_total'] = intval($mode[3]);
120 $macro[
'segment_index'] = intval($mode[4]);
121 $macro[
'file_id'] = strtr($mode[5],
"\xff",
',');
122 for ($i = 0; $i < 7; ++$i) {
124 if (isset($mode[$o]) AND ($mode[$o] !==
'')) {
126 $macro[
'option_'.$i] = strtr($mode[$o],
"\xff",
',');
130 $qrcode =
new PDF417($code, $ecl, $aspectratio, $macro);
131 $this->barcode_array = $qrcode->getBarcodeArray();
137 $code = preg_replace(
'/[\s]*/si',
'', $code);
138 if (strlen($code) < 3) {
141 if ($qrtype ==
'RAW') {
143 $rows = explode(
',', $code);
146 $code = substr($code, 1, -1);
147 $rows = explode(
'][', $code);
149 $this->barcode_array[
'num_rows'] = count($rows);
150 $this->barcode_array[
'num_cols'] = strlen($rows[0]);
151 $this->barcode_array[
'bcode'] = array();
152 foreach ($rows as $r) {
153 $this->barcode_array[
'bcode'][] = str_split($r, 1);
158 $this->barcode_array[
'num_rows'] = 5;
159 $this->barcode_array[
'num_cols'] = 15;
160 $this->barcode_array[
'bcode'] = array(
161 array(1,1,1,0,1,1,1,0,1,1,1,0,1,1,1),
162 array(0,1,0,0,1,0,0,0,1,0,0,0,0,1,0),
163 array(0,1,0,0,1,1,0,0,1,1,1,0,0,1,0),
164 array(0,1,0,0,1,0,0,0,0,0,1,0,0,1,0),
165 array(0,1,0,0,1,1,1,0,1,1,1,0,0,1,0));
169 $this->barcode_array =
false;