How print qr code in epson tm-t88v from php -
i try print qr code in epson pos tm-t88v form php , can't. information epson-biz.com no clear @ all, , search , no example correct steeps print qr code. print text no problems, qr code no work. code tri follow epson documentation esc-pos:
if(($handle = @fopen("lpt1", "w")) === false){ die('i can't print, check connection'); } fwrite($handle,chr(27). chr(64));//restart fwrite($handle, chr(27). chr(100). chr(0)); fwrite($handle, chr(27). chr(33). chr(8)); fwrite($handle, chr(27). chr(97). chr(1)); fwrite($handle,"================================="); fwrite($handle, chr(27). chr(100). chr(1)); fwrite($handle, chr(27). chr(32). chr(3)); fwrite($handle," no 1005 "); fwrite($handle, chr(27). chr(32). chr(0)); fwrite($handle, chr(27). chr(100). chr(0)); fwrite($handle, chr(27). chr(33). chr(8)); fwrite($handle, chr(27). chr(100). chr(0)); fwrite($handle, chr(27). chr(100). chr(1)); fwrite($handle,"================================="); fwrite($handle, chr(27). chr(100). chr(3)); // here work, rest problem: fwrite($handle, chr(29).chr(40).chr(107).chr(4).chr(0).chr(49).chr(65).chr(50).chr(0)); // function 165 fwrite($handle, chr(29).chr(40).chr(107).chr(3).chr(0).chr(49).chr(67).chr(20)); // function 167 fwrite($handle, chr(29).chr(40).chr(107).chr(3).chr(0).chr(49).chr(69).chr(48)); // function 169 fwrite($handle, chr(29).chr(40).chr(107).chr(3).chr(0).chr(49).chr(80).chr(48)); // function 180 fwrite($handle,"texto de prueba de codigo qr"); // text go qr fwrite($handle, chr(29).chr(40).chr(107).chr(3).chr(0).chr(49).chr(81).chr(48)); //function 181 fwrite($handle, chr(29).chr(40).chr(107).chr(3).chr(0).chr(49).chr(82).chr(48)); //function 182 fwrite($handle, chr(27). chr(100). chr(6)); fwrite($handle, chr(29). chr(86). chr(1));// cut paper fclose($handle); $exitmsj = shell_exec('lpr lpt1');
for example, documentation epson-biz.com function 165 (i try follow decimal part in php code):
gs ( k <function 165> ________________________________________ [models] • tm-j2000 • tm-j2100 • tm-l90 • tm-p60 • tm-p60ii • tm-p80 • tm-t20 • tm-t20ii • tm-t70 • tm-t70ii • tm-t82ii • tm-t88iv • tm-t88v • tm-t90 • tm-u220 • tm-u230 [name] qr code: select model [format] ascii gs ( k pl ph cn fn n1 n2 hex 1d 28 6b 04 00 31 41 n1 n2 decimal 29 40 107 4 0 49 65 n1 n2 [range] (pl + ph × 256) = 4 cn = 49 fn = 65 n2 = 0 n1: different depending on printers [default] n1 = 50, n2 = 0 [description] selects model qr code. n1 function 49 selects model 1 50 selects model 2 51 selects micro qr code [notes] settings of function affect processing of function 181 , 182. settings of function effective until esc @ executed, printer reset, or power turned off.
please succeeded in print qr code using comands esc-pos? don't know if order of functions (165, 167, 169, 180, 181, 182) correct.
change this:
fwrite($handle, chr(29).chr(40).chr(107).chr(3).chr(0).chr(49).chr(80).chr(48)); // function 180
for this:
fwrite($handle, chr(29).chr(40).chr(107).chr(31).chr(0).chr(49).chr(80).chr(48)); // function 180 <function 180> gs ( k pl ph cn fn m d1…dk (cn = 49, fn = 80) k = (pl + ph x 256) – 3
k = hom many characters wanna print?, send "texto de prueba de codigo qr" (28).
k = (31 + 0 x 256) - 3 k = (31 + 0) - 3 k = 31 - 3 k = 28
all other things follow default values commands.
Comments
Post a Comment