Best regards to all: Veran I am trying to print a label with the language of zebra, from node js So far it has been possible to connect to the zebra printer (S4M) and print. The problem I have is that it only prints plain text and does not interpret the zebra code. Will someone know if there is a library or something similar that allows me to send the zebra codes to a printer from node js? or a way to do it. Any help or comment will be very much appreciated. This is the source that is carried so far. Thank you :)
require('node-native-printer/src/windows_printer.js'.setPrinter);
require('./lib.js').your_function();
const printer = require('node-native-printer');
constWindows =require('node-native-printer/src/windows_printer.js')
const lista=printer.listPrinters(constWindows);
console.log(lista);
let printer_name= 'ZDesigner S4M';
printer.setPrinter(printer_name)
function printZebra(filename, options, printer_name){
// printer.setPrinter(printer_name)
// console.log('________________________________________________');
// printer.printerInfo(printer_name)
// printer.print(filename,options, printer_name)
var text = '^XA^LH15,15^FO15,10^BY2^BCN,55,N,N,N^FD[[CODIGO]]^FS^FO100,72^A0,30,23^FD[[CODIGO]]^FS^FO285,15^A0,60,53^FD[[PRECIO]]^FS^FO25,100^A0,24,20^FD[[PRODUCTO]]^FS^XZ'
printer.printText(text,options, printer_name)//imprime txt
}
printZebra("C:\impresion_zebra.txt", {
"collate": true,
"color": true,
"copies": 1,
"duplex": "Default",
"landscape": false,
"paperSize": "",
}, printer_name);