I try print qr code in a epson pos TM-T88V form php and I can't. The information I get from epson-biz.com is no clear at all, and I search and no get any example about the correct steeps to print QR code. I print text no problems, but QR code no work. This is the code I tri follow the epson documentation about ESC-POS:
if(($handle = @fopen("LPT1", "w")) === FALSE){
die('I can't print, check your 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));
// to here work, but the rest is the 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"); // this text go to 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, the documentation I get from epson-biz.com say about Function 165 (I try to follow decimal part in my 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 the 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 the printers
[Default] n1 = 50, n2 = 0
[Description] Selects the model for QR Code.
n1 Function
49 Selects model 1
50 Selects model 2
51 Selects Micro QR Code
[Notes] Settings of this function affect the processing of Function 181 and 182.
Settings of this function are effective until ESC @ is executed, the printer is reset, or the power is turned off.
Please someone who succeeded in print QR code using comands ESC-POS? I don't know if the order of the Functions (165, 167, 169, 180, 181, 182) are correct.