Open AceRex opened 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
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); });