Re: CODE 39 to CODE 128

40 views
Skip to first unread message

Tres Finocchiaro

unread,
Aug 5, 2023, 6:35:30 PM8/5/23
to Nikhil Sharma, qz-print
Quoting the ESC/POS programming guide, CODE128 falls under "<Function B>".

image.png

The only difference it seems from Code39 is:
  • CODE128 does NOT require the NUL character (coded as "chr(0)") at the end
  • The "m" value is changed from "chr(69)" to "chr(73)".

Can you try this?

//barcode data
var code = 'https://qz.io';

//convenience method
var chr = function(n) { return String.fromCharCode(n); };

var barcode = '\x1D' + 'h' + chr(80) + //barcode height
'\x1D' + 'f' + chr(0) + //font for printed number
'\x1D' + 'k' + chr(73) + chr(code.length) + code; //code128

qz.websocket.connect().then(function() {
var config = qz.configs.create("Epson TM88V");
return qz.print(config, ['\n\n\n\n\n' + barcode + '\n\n\n\n\n']);
}).catch(function(err) { alert(err); });


Per:
image.png



On Sat, Aug 5, 2023 at 1:03 PM Nikhil Sharma <stfs1...@gmail.com> wrote:
Hi I have received your concern.

and the code snippet is as belows:

//barcode data
var code = '12345';

//convenience method
var chr = function(n) { return String.fromCharCode(n); };

var barcode = '\x1D' + 'h' + chr(80) +   //barcode height
    '\x1D' + 'f' + chr(0) +              //font for printed number
    '\x1D' + 'k' + chr(69) + chr(code.length) + code + chr(0); //code39

qz.websocket.connect().then(function() {
   var config = qz.configs.create("Epson TM88V");
   return qz.print(config, ['\n\n\n\n\n' + barcode + '\n\n\n\n\n']);
}).catch(function(err) { alert(err); });

Please help to make it convert to CODE 128 Barcode

Regards,
Nikhil

Nikhil Sharma

unread,
Aug 7, 2023, 2:36:07 AM8/7/23
to Tres Finocchiaro, qz-print
Ok, I will check. 

Thanks will let you know if its working
Reply all
Reply to author
Forward
0 new messages