Nodejs Epson Thermal Printer

1

I'm using the node-thermal-printer plugin on NodeJs to print to an Epson printer. But after putting it on a server it does not work, meaning it does not detect the printer.

var printer = require("node-thermal-printer");

printer.init({
  type: printer.printerTypes.EPSON, // 'star' or 'epson'
  interface: '/dev/usb/lp1', // Linux interface
  characterSet: 'UTF-8', // Printer character set
  removeSpecialCharacters: false, // Removes special characters - default: false
  replaceSpecialCharacters: true, // Replaces special characters listed in config files - default: true
});

printer.isPrinterConnected(function(response) {
  console.log("Printer connected:", response);
  connected = response;
});

printer.execute(function(err) {
  if (err) {
    console.error("Print failed", err);
  } else {
    console.log("Print done");
  }
});

Printer this location.

When I run node "localhost" it works perfectly.

    
asked by anonymous 05.11.2017 / 20:00

0 answers