com.sewoo.jpos
Class POSPrinterService

java.lang.Object
  extended by com.sewoo.jpos.POSPrinterService

public class POSPrinterService
extends java.lang.Object

POSPrinterService. (ESCPOS)

see the POSPrinterConst class for Constant Parameter.

Since:
1.00

Field Summary
 java.lang.String fontTypefaceList
           
 
Constructor Summary
POSPrinterService()
           
 
Method Summary
 int alignment(int align)
          set Bitmap, Barcode Alignment.
 byte getBarCodeSymbol(int symbol)
          get Barcode Symbol.
 boolean getCapRecBarCode()
          Receipt Barcode Available.
 int getMapMode()
          get MapMode.
 int getRecLineChars()
          Receipt Line Characters.
 int getRecLineWidth()
          Receipt length.
 void printBarCode(int station, java.lang.String data, int symbology, int height, int width, int alignment, int textPosition)
          Print Barcode.
 int printBitmap(int station, int[][] bImage, int width, int alignment)
          Print Bitmap Image.
 int printBitmap(int station, java.lang.String filePath, int width, int alignment)
          Print Bitmap Image.
 void printNormal(int station, java.lang.String data)
          Print Normal Text.
 void selectPrinterModel(int productN)
          select mobile printer model.
 void sendMSRInit()
           
 void sendMSRMode(int mode)
           
 void sendMSRStatusCheck()
          Need to Read after call this method.
 void sendMSRtoNormalMode()
           
 int setBarCodeDataPosition(int position)
          set Barcode Data Position.
 int setBarCodeHeight(int height)
          set Barcode Height.
 int setBarCodeWidth(int width, int dataLength)
          set Barcode Width.
 int setBitmap(int bitmapNumber, int station, java.lang.String fileName, int width, int alignment)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fontTypefaceList

public final java.lang.String fontTypefaceList
See Also:
Constant Field Values
Constructor Detail

POSPrinterService

public POSPrinterService()
Method Detail

printNormal

public void printNormal(int station,
                        java.lang.String data)
                 throws JposException
Print Normal Text.

Parameters:
station - Station
        PTR_S_JOURNAL
        PTR_S_RECEIPT
        PTR_S_SLIP
 
data - Text data
Throws:
JposException

printBarCode

public void printBarCode(int station,
                         java.lang.String data,
                         int symbology,
                         int height,
                         int width,
                         int alignment,
                         int textPosition)
                  throws JposException
Print Barcode.

Parameters:
station - Station
        PTR_S_JOURNAL
        PTR_S_RECEIPT
        PTR_S_SLIP
 
data - Barcode data
symbology - Barcode symbol type
 PTR_BCS_UPCA
 PTR_BCS_UPCE
 PTR_BCS_EAN8
 PTR_BCS_JAN8
 PTR_BCS_EAN13
 PTR_BCS_JAN13
 PTR_BCS_ITF 
 PTR_BCS_Codabar
 PTR_BCS_Code39
 PTR_BCS_Code93
 PTR_BCS_Code128
 
height - Barcode height (1 - 255)
width - Barcode width (2 - 6)
alignment - Barcode alignment
        PTR_BC_LEFT
        PTR_BC_CENTER
        PTR_BC_RIGHT
 
textPosition - Print position of barcode HRI letters(barcode data)
        PTR_BC_TEXT_NONE
 PTR_BC_TEXT_ABOVE
 PTR_BC_TEXT_BELOW
 
Throws:
JposException

printBitmap

public int printBitmap(int station,
                       java.lang.String filePath,
                       int width,
                       int alignment)
                throws JposException,
                       java.io.IOException
Print Bitmap Image.

Parameters:
station - Station
        PTR_S_JOURNAL
        PTR_S_RECEIPT
        PTR_S_SLIP
 
filePath - Image file path
width - Image width
 PTR_BM_ASIS Print the bitmap with one bitmap pixel per printer dot.
 Other Values Bitmap width expressed in the unit of measure given by MapMode.
 
alignment - Image alignment
        PTR_BM_LEFT
        PTR_BM_CENTER
        PTR_BM_RIGHT
 
Returns:
LKPrint.LK_SUCCESS, LKPrint.LK_FAIL
Throws:
JposException
java.io.IOException

printBitmap

public int printBitmap(int station,
                       int[][] bImage,
                       int width,
                       int alignment)
                throws JposException,
                       java.io.IOException
Print Bitmap Image.

Parameters:
station - Station
        PTR_S_JOURNAL
        PTR_S_RECEIPT
        PTR_S_SLIP
 
bImage - Image data
width - Image width
 PTR_BM_ASIS Print the bitmap with one bitmap pixel per printer dot.
 Other Values Bitmap width expressed in the unit of measure given by MapMode.
 
alignment - alignment
        PTR_BM_LEFT
        PTR_BM_CENTER
        PTR_BM_RIGHT
 
Returns:
LKPrint.LK_SUCCESS, LKPrint.LK_FAIL
Throws:
JposException
java.io.IOException

setBitmap

public int setBitmap(int bitmapNumber,
                     int station,
                     java.lang.String fileName,
                     int width,
                     int alignment)
              throws java.io.IOException
Parameters:
bitmapNumber -
station - The printer station to be used. May be either PTR_S_RECEIPT or PTR_S_SLIP.
fileName -
width - PTR_BM_ASIS or Others
alignment -
Returns:
LKPrint.LK_SUCCESS, LKPrint.LK_FAIL
Throws:
java.io.IOException

setBarCodeWidth

public int setBarCodeWidth(int width,
                           int dataLength)
set Barcode Width.

Parameters:
width - Barcode width
dataLength - Barcode data length

setBarCodeHeight

public int setBarCodeHeight(int height)
                     throws JposException
set Barcode Height.

Parameters:
height - Barcode height
Throws:
JposException

setBarCodeDataPosition

public int setBarCodeDataPosition(int position)
set Barcode Data Position.

Parameters:
position - Position to printing HRI characters(Barcode data).
        PTR_BC_TEXT_NONE
        PTR_BC_TEXT_ABOVE
        PTR_BC_TEXT_BELOW
 

getBarCodeSymbol

public byte getBarCodeSymbol(int symbol)
get Barcode Symbol.

Parameters:
symbol - Barcode symbol
 PTR_BCS_UPCA
 PTR_BCS_UPCE
 PTR_BCS_EAN8
 PTR_BCS_JAN8
 PTR_BCS_EAN13
 PTR_BCS_JAN13
 PTR_BCS_ITF 
 PTR_BCS_Codabar
 PTR_BCS_Code39
 PTR_BCS_Code93
 PTR_BCS_Code128
 
Returns:
byte

alignment

public int alignment(int align)
              throws JposException
set Bitmap, Barcode Alignment.

Parameters:
align - alignment position
Returns:
int
Throws:
JposException

selectPrinterModel

public void selectPrinterModel(int productN)
select mobile printer model.

Parameters:
productN - see the SewooConst

getMapMode

public int getMapMode()
get MapMode.

Returns:
selected MapMode.

getCapRecBarCode

public boolean getCapRecBarCode()
Receipt Barcode Available.

Returns:
true

getRecLineWidth

public int getRecLineWidth()
Receipt length.

Returns:
Line width.

getRecLineChars

public int getRecLineChars()
Receipt Line Characters.

Returns:
Character per line.

sendMSRInit

public void sendMSRInit()

sendMSRMode

public void sendMSRMode(int mode)

sendMSRStatusCheck

public void sendMSRStatusCheck()
Need to Read after call this method.


sendMSRtoNormalMode

public void sendMSRtoNormalMode()