Hubertformin / electron-pos-printer

Electron-pos-printer is a plugin that works to ease paper formatting and printing to thermal printers. it currently supports 80mm, 78mm, 76mm, 58mm, 57mm and 44mm printers thermal printers. it is built with Electron.js and Node.js
Apache License 2.0
318 stars 102 forks source link

Retruns undefined #115

Open AceRex opened 9 months ago

AceRex commented 9 months ago

const PosPrintOptions = { copies: 1, preview: false, printerName: "Xprinter_USB_Printer_P_2", margin: "1px 2px 2px 2px", timeOutPerLine: 400, pageSize: "80mm", };

const PosPrintData = [ { type: "text", value: "testing the printer", style: { fontWeight: "700", textAlign: "center", fontSize: "24px" }, }, { type: "barCode", value: "023456789010", height: 40, // height of barcode, applicable only to bar and QR codes width: 2, // width of barcode, applicable only to bar and QR codes displayValue: true, // Display value below barcode fontsize: 12, }, { type: "qrCode", value: "https://github.com/Hubertformin/electron-pos-printer", height: 55, width: 55, style: { margin: "10 20px 20 20px" }, }, ];

PosPrinter.print(PosPrintData, PosPrintOptions) .then(console.log) .catch((error) => { console.error(error); });

 this keeps returning undefined