Printing QR codes

3,584 views
Skip to first unread message

ata...@gmail.com

unread,
Jan 11, 2016, 1:27:24 PM1/11/16
to qz-print
Hello,

I have a question regarding printing QR codes on a Star TSP100 printer.

I followed the specifications in the programming manual and got the following set of commands:

// Set QR code model qz.append(chr(27)+chr(29)+chr(121)+chr(83)+chr(48)+chr(2));

// Set QR code mistake correction level qz.append(chr(27)+chr(29)+chr(121)+chr(83)+chr(49)+chr(1));

// Set QR code cell size qz.append(chr(27)+chr(29)+chr(121)+chr(83)+chr(50)+chr(3));

// Set QR code cell size (Auto Setting) qz.append(chr(27)+chr(29)+chr(121)+chr(68)+chr(49)+chr(0)+chr(60)+chr(0)+'data');
// Print QR code
qz.append(chr(27)+chr(29)+chr(121)+chr(80));

The problem is that nothing happens when the commands are sent to the printer.
Have someone tried printing qr codes? Have I made a mistake? I guess there cannot be a problem with the plugin, right? Even though, there is a command for printing the qr code. Could it be somehow a conflict between the "print qr code" command and the print function?

Best regards.

Lite Finocchiaro

unread,
Jan 11, 2016, 1:40:04 PM1/11/16
to ata...@gmail.com, qz-print
Are you using OSX or Linux to send the print job? The TSP100 can only print raw print jobs in Windows. The same caveat applies to the TSP143. Does your other code print ok?

Are you using the Epson ESCP manual, or one provided by Star?


--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ata...@gmail.com

unread,
Jan 11, 2016, 1:52:27 PM1/11/16
to qz-print, ata...@gmail.com
Thank you for the quick response.
I am using Windows atm. I found these commands in the manual provided by Star. I am also trying to print the qr code on a Posiflex Aura 9600 printer. This printer uses the command set from the Epson manual, but again nothing is printed. Text, alignments, coding and cut commands work OK.

Lite Finocchiaro

unread,
Jan 11, 2016, 2:06:19 PM1/11/16
to ata...@gmail.com, qz-print
How are you fetching 'data' for your QR Code? PHP, AJAX, ASP.net? I recommend sending the print job to a flat file (printtoFile) and examining exactly what is sent to the printer. I have a feeling that the method you use to fetch 'data' is either converting your data to a string that the printer doesn't understand, or possibly adding characters at the beginning and end of the string, which would also corrupt the code. If you would like to send me a sample string for 'data' that I can put directly into your code example, I'll be happy to test it against my Epson TM-T88V here in my lab.

Ales Tavcar

unread,
Jan 11, 2016, 2:21:03 PM1/11/16
to Lite Finocchiaro, qz-print
Yes, I am fetching the data from a server-side function that calculates the code. However, I created a simple test set to verify if my commands work OK.

If you could test the code on an actual Epson printer, that would be great, thank you!

Here is the code:
//Select the model
qz.append(chr(29)+chr(40)+chr(107)+chr(4)+chr(0)+chr(49)+chr(65)+chr(50)+chr(0));
//Set the size
qz.append(chr(29)+chr(40)+chr(107)+chr(3)+chr(0)+chr(49)+chr(67)+chr(32));
//Error correction M
qz.append(chr(29)+chr(40)+chr(107)+chr(3)+chr(0)+chr(49)+chr(69)+chr(49));
//Store the data
qz.append(chr(29)+chr(40)+chr(107)+chr(5)+chr(0)+chr(49)+chr(80)+chr(48)+"01");
//Print
qz.append(chr(29)+chr(40)+chr(107)+chr(3)+chr(0)+chr(49)+chr(81)+chr(48));

This should work, unless I am missing something from the manual.

Thank you again.

Lite Finocchiaro

unread,
Jan 11, 2016, 5:04:23 PM1/11/16
to Ales Tavcar, qz-print
I get the same results on my Epson TM-T88V using your code. The rest of my code prints fine, but the QR Code is ignored and produces nothing. Let me study the syntax and get back to you.

Lite Finocchiaro

unread,
Apr 5, 2017, 4:31:28 PM4/5/17
to Ales Tavcar, qz-print
I'm sure you have discovered how to implement this, but here is a block of code I used to generate a QR Code using ESC/POS or ESCP on an Epson TM-T88V using QZ-Tray 2.0.3:

https://gist.github.com/lite1979/765161431c08dafdf9eade7eea5d62e6


To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.

Tres Finocchiaro

unread,
Dec 29, 2017, 5:04:50 PM12/29/17
to Lite Finocchiaro, Ales Tavcar, qz-print
Turns out of example wouldn't allow more than 13 characters.  Here's an updated example:

Reply all
Reply to author
Forward
0 new messages