It does not print barcode

1,144 views
Skip to first unread message

heiheshang

unread,
Oct 8, 2016, 8:44:38 AM10/8/16
to qz-print
I am trying to print a bar code on epson lx 350 +
but I see only numbers
var data = [
    '\x1B' + '\x40', // init
    '\x1D' + '\x4A' + '\x1D' + '\x4F',
    '\x1D' + '\x2F' + '\x6D', // gs / m range?
    '\x1B' + '\x63' + '\x33',
    '\x1D' + '\x68' + '\x31' + '\x1D' + '\x6B',
    '123131321313131',
    '\x1B' + '\x61' + '\x30', // left align
    '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A'

    ];
    return qz.print(config,data);
I do not understand what the problem is

Tres Finocchiaro

unread,
Oct 8, 2016, 11:02:28 AM10/8/16
to heiheshang, qz-print
It's hard to read hex as decimal, so we generally recommend making a chr() function.

Also, not all ESC/POS printers support barcodes.

Here's an example that works on a modern TM-T88V printer:

//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 HRI chars
    '\x1D' + 'k' + chr(69) + chr(code.length) + code + chr(0) // barcode smb 39

Sample output:

Inline image 1

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

heiheshang

unread,
Oct 8, 2016, 11:24:17 PM10/8/16
to qz-print, strangerf...@gmail.com
the printer does not respond to this command.
esc codes prints.gs codes are not printed. Printer epson lx 350. I do not understand what the problem is 

воскресенье, 9 октября 2016 г., 0:02:28 UTC+9 пользователь Tres Finocchiaro написал:
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.

heiheshang

unread,
Oct 9, 2016, 4:13:15 AM10/9/16
to qz-print, strangerf...@gmail.com
[DEBUG] 2016-10-09 17:10:56,903 @ qz.printer.PrintServiceMatcher:?
Found match: EPSON_LX-300
[DEBUG] 2016-10-09 17:10:58,428 @ qz.ws.PrintSocketClient:?
Message: {"call":"print","promise":{},"params":{"printer":{"name":"EPSON_LX-300"},"options":{"colorType":"blackwhite","copies":1,"density":0,"duplex":false,"fallbackDensity":600,"interpolation":"bicubic","jobName":null,"margins":0,"orientation":null,"paperThickness":null,"printerTray":null,"rasterize":true,"rotation":0,"scaleContent":true,"size":null,"units":"in","altPrinting":false,"encoding":null,"endOfDoc":null,"perSpool":1},"data":[{"data":"\u001b(B\u0013\u0000\u0000\u0002\u0000}\u0000\u00000123456789012","options":{"language":"escp"},"type":"raw"}]},"timestamp":1476000658424,"uid":"w0lo5r"}
[INFO] 2016-10-09 17:10:59,398 @ qz.common.TrayManager:?
Allowed An anonymous request to print to EPSON_LX-300
[TRACE] 2016-10-09 17:10:59,399 @ qz.utils.PrintingUtilities:?
Waiting for processor, 0/7 already in use
[DEBUG] 2016-10-09 17:10:59,403 @ qz.utils.PrintingUtilities:?
Using qz.printer.action.PrintRaw to print
[DEBUG] 2016-10-09 17:10:59,403 @ qz.printer.PrintServiceMatcher:?
Searching for PrintService matching EPSON_LX-300
[DEBUG] 2016-10-09 17:10:59,404 @ qz.printer.PrintServiceMatcher:?
Found 1 printers
[DEBUG] 2016-10-09 17:10:59,405 @ qz.printer.PrintServiceMatcher:?
Found match: EPSON_LX-300
[TRACE] 2016-10-09 17:10:59,405 @ qz.printer.action.PrintRaw:?
Sending print job to printer
[DEBUG] 2016-10-09 17:10:59,407 @ qz.printer.action.PrintRaw:?
PrintEvent on sun.print.UnixPrintJob@1c8f5ffe
[DEBUG] 2016-10-09 17:10:59,427 @ qz.printer.action.PrintRaw:?
PrintEvent on sun.print.UnixPrintJob@1c8f5ffe
[DEBUG] 2016-10-09 17:10:59,428 @ qz.printer.action.PrintRaw:?
PrintEvent on sun.print.UnixPrintJob@1c8f5ffe
[DEBUG] 2016-10-09 17:10:59,429 @ qz.printer.action.PrintRaw:?
PrintEvent on sun.print.UnixPrintJob@1c8f5ffe
[TRACE] 2016-10-09 17:10:59,429 @ qz.printer.action.PrintRaw:?
Print job received by printer
[INFO] 2016-10-09 17:10:59,431 @ qz.utils.PrintingUtilities:?
Printing complete
[TRACE] 2016-10-09 17:10:59,432 @ qz.utils.PrintingUtilities:?
Returning processor back to pool




воскресенье, 9 октября 2016 г., 0:02:28 UTC+9 пользователь Tres Finocchiaro написал:
It's hard to read hex as decimal, so we generally recommend making a chr() function.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.

Tres Finocchiaro

unread,
Oct 9, 2016, 9:21:06 AM10/9/16
to heiheshang, qz-print
You will need to cross reference a compatible barcode.  Epson's website claims it supports the following formats:
  • EAN-13
  • EAN-8
  • Interleaved 2 of 5
  • UPC-A, UPC-E
  • Code 39
  • Code 128
  • POSTNET
ESC/POS language will vary based on printer.  You may also choose to use the IBM Pro emulation.

If you are looking for an exact working example for your printer, you will need to contact Epson support or use trial-and-error as we have.  We provide this sample as a courtesy.  It is not meant to be comprehensive for all Epson printers.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.

Xybrek Zybrek

unread,
Oct 20, 2016, 12:43:09 PM10/20/16
to qz-print

Tres Finocchiaro

unread,
Oct 20, 2016, 1:17:32 PM10/20/16
to Xybrek Zybrek, qz-print
I've added an alternate solution which uses ESC/POS to your solution.


Best regards,
Reply all
Reply to author
Forward
0 new messages