如何打开与热打印机连接的现金抽屉?

问题描述 投票:0回答:2
IM使用Epson JPOS ADK作为我的热式打印机,我使用RJ-12电缆连接CashDrawer,但它不会打开CashDrawer。我可以用我的热式打印机打印。 我的代码是我的代码:

System.setProperty(JposPropertiesConst.JPOS_POPULATOR_FILE_PROP_NAME, "jpos_path"); POSPrinterControl114 printer = (POSPrinterControl114) new POSPrinter(); CashDrawerControl114 cashDrawer = (CashDrawerControl114) new CashDrawer(); try { printer.open("POSPrinter"); printer.claim(1000); printer.setDeviceEnabled(true); printer.printNormal(POSPrinterConst.PTR_S_RECEIPT, "Test Print\n"); cashDrawer.open("CashDrawer"); cashDrawer.claim(1000); cashDrawer.setDeviceEnabled(true); cashDrawer.openDrawer(); } catch (JposException e) { e.printStackTrace(); }finally { try { cashDrawer.setDeviceEnabled(false); cashDrawer.release(); cashDrawer.close(); printer.setDeviceEnabled(false); printer.release(); printer.close(); } catch (JposException e) { e.printStackTrace(); } }

我可以肯定的是,您需要按照您的写作来完全做事。您可以使用
Star Micronics TSP100 Configuration
java
2个回答
0
投票

确保您的打印机连接已连接并尝试使用
printerConnection.write(byteArrayOf(0x1B, 0x70, 0x00, 0x3C, 0xFF.toByte())) printerConnection.send(100)


-1
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.