2

I am using qz-tray to print some bills using a dot matrix printer (Epson LX 310). The code I use is as follows

qz.websocket.connect().then(function() {
  console.log("Connected!");
});
var printer = "Epson LX-310";
var config = qz.configs.create(printer);
var data = [data_string];
qz.print(config, data).catch(function(e) { console.error(e); });

There are no errors when running the code, and the print job is added to the printer's queue. But it is rejected right away.

The version of qz-tray I use is 2.1.2 and the OS is Windows 10.

Aneeez
  • 1,422
  • 3
  • 15
  • 20
  • When you say "rejected right away", do does the job show up and disappear from the queue or go into error state? If it's disappearing from the queue this may be a sign that your `data_string` is malformatted for this printer. The printer should accept both `ESC/P` as well as `IBM PPDS` command emulation. See also https://stackoverflow.com/a/67490249/3196753. – tresf May 11 '21 at 16:26

0 Answers0