How can I develop Java Software to print reciepts with an Epson reciept printer?
System.setProperty(JposPropertiesConst.JPOS_POPULATOR_FILE_PROP_NAME, System.getenv("jposxml_path"));
Now you are ready to go!
Example:
POSPrinterControl113 printer = (jpos.POSPrinterControl113) new POSPrinter(); CashDrawerControl113 drawer = (CashDrawerControl113) new CashDrawer(); try { printer.open("POSPrinter"); printer.claim(100); printer.setDeviceEnabled(true); } catch (Exception e) { System.err.println("Printer deactivated " + e.getMessage()); printerdisabled = true; drawerdisabled = true; return; } try { drawer.open("CashDrawer"); drawer.claim(100); drawer.setDeviceEnabled(true); } catch (Exception e) { System.out.println("Cashdrawer deactivated: " + e.getMessage()); drawerdisabled = true; return; }
2.1m questions
2.1m answers
60 comments
57.0k users