We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this is my code
AsyncEscPosPrinter printerData = printersData[0]; try { DeviceConnection deviceConnection = printerData.getPrinterConnection(); if(deviceConnection == null) { return new PrinterStatus(null, AsyncEscPosPrint.FINISH_NO_PRINTER); } EscPosPrinter printer = new EscPosPrinter( deviceConnection, printerData.getPrinterDpi(), printerData.getPrinterWidthMM(), printerData.getPrinterNbrCharactersPerLine(), new EscPosCharsetEncoding("windows-1252", 16) ); printer.useEscAsteriskCommand(true); this.publishProgress(AsyncEscPosPrint.PROGRESS_PRINTING); String[] textsToPrint = printerData.getTextsToPrint(); for(String textToPrint : textsToPrint) { printer.printFormattedTextAndCut(textToPrint); Thread.sleep(500); } // here I am sending command to open cash box if(deviceConnection.isConnected()){ deviceConnection.write(new byte[]{0x1B, 0x70, 0x00, 0x19, (byte) 0xFA}); deviceConnection.send(100); } else{ Log.d("printer connection", "device connection not connected"); } } catch (EscPosConnectionException e) { e.printStackTrace(); return new PrinterStatus(printerData, AsyncEscPosPrint.FINISH_PRINTER_DISCONNECTED); } catch (EscPosParserException e) { e.printStackTrace(); return new PrinterStatus(printerData, AsyncEscPosPrint.FINISH_PARSER_ERROR); } catch (EscPosEncodingException e) { e.printStackTrace(); return new PrinterStatus(printerData, AsyncEscPosPrint.FINISH_ENCODING_ERROR); } catch (EscPosBarcodeException e) { e.printStackTrace(); return new PrinterStatus(printerData, AsyncEscPosPrint.FINISH_BARCODE_ERROR); } catch (InterruptedException e) { e.printStackTrace(); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
this is my code
The text was updated successfully, but these errors were encountered: