Пример #1
0
  @Override
  public void openDrawer() {

    m_CommOutputPrinter.write(ESCPOS.SELECT_PRINTER);
    m_CommOutputPrinter.write(m_codes.getOpenDrawer());
    m_CommOutputPrinter.flush();
  }
 @Override
 public void endReceipt() {
   m_CommOutputPrinter.write(ESCPOS.SELECT_PRINTER);
   m_CommOutputPrinter.write(m_codes.getNewLine());
   m_CommOutputPrinter.write(m_codes.getNewLine());
   m_CommOutputPrinter.write(m_codes.getNewLine());
   m_CommOutputPrinter.write(m_codes.getNewLine());
   m_CommOutputPrinter.write(m_codes.getNewLine());
   m_CommOutputPrinter.write(m_codes.getCutReceipt());
   m_CommOutputPrinter.flush();
 }
Пример #3
0
  // Creates new TicketPrinter
  public DevicePrinterESCPOS(PrinterWritter CommOutputPrinter, Codes codes, UnicodeTranslator trans)
      throws TicketPrinterException {

    m_sName = AppLocal.getIntString("Printer.Serial");
    m_CommOutputPrinter = CommOutputPrinter;
    m_codes = codes;
    m_trans = trans;

    // Inicializamos la impresora
    m_CommOutputPrinter.init(ESCPOS.INIT);

    m_CommOutputPrinter.write(ESCPOS.SELECT_PRINTER); // A la impresora
    m_CommOutputPrinter.init(m_codes.getInitSequence());
    m_CommOutputPrinter.write(m_trans.getCodeTable());

    m_CommOutputPrinter.flush();
  }