com.sewoo.jpos.printer
Class ESCPOSPrinter

java.lang.Object
  extended by com.sewoo.jpos.printer.ESCPOSPrinter

public class ESCPOSPrinter
extends java.lang.Object

ESCPOSPrinter

Since:
1.03

Constructor Summary
ESCPOSPrinter()
           
ESCPOSPrinter(java.lang.String charset)
          Constructor
 
Method Summary
 void lineFeed(int lfCount)
          2.8.
 void printBarCode(java.lang.String data, int symbology, int height, int width, int alignment, int textPosition)
           
 int printBitmap(java.lang.String bitmapName, int alignment)
          2.6.
 int printerCheck()
          2.9.
 void printNormal(java.lang.String data)
          2.3.
 void printNVBitmap(int nvImageNumber)
          2.11.
 void printString(java.lang.String data)
          2.4.
 void printText(java.lang.String data, int alignment, int attribute, int textSize)
          2.5.
 int status()
          2.10. status
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ESCPOSPrinter

public ESCPOSPrinter()

ESCPOSPrinter

public ESCPOSPrinter(java.lang.String charset)
Constructor

Parameters:
charset -
 "UTF-8" (Default)
 "EUC-KR"
 
Method Detail

printNormal

public void printNormal(java.lang.String data)
                 throws java.io.UnsupportedEncodingException
2.3. PrintNormal

Parameters:
data - - Unicode string. It is same as PrintNormal function in OLE POS Command.
Throws:
java.io.UnsupportedEncodingException

printString

public void printString(java.lang.String data)
                 throws java.io.UnsupportedEncodingException
2.4. PrintString

Parameters:
data - - Unicode string. It sets Unicode String to print.
Throws:
java.io.UnsupportedEncodingException

printText

public void printText(java.lang.String data,
                      int alignment,
                      int attribute,
                      int textSize)
               throws java.io.UnsupportedEncodingException
2.5. PrintText

Parameters:
data - - Unicode string. It sets Unicode text to print.
alignment - - This value is alignment. It sets text alignment.
 LK_ALIGNMENT_LEFT Left alignment 
 LK_ALIGNMENT_CENTER Center alignment
 LK_ALIGNMENT_RIGHT Right alignment
 
attribute - - This value is text attributes. It sets text attributes to print.
 LK_FNT_DEFAULT FontA, Set up as a standard
 LK_FNT_FONTB Set up as FontB
 LK_FNT_BOLD Set up as Bold attribute
 LK_FNT_UNDERLINE Set up as Underline attribute
 
textSize - - This value is text size. It sets text size to print.
 LK_TXT_1WIDTH Set up width ratio as x1 
 LK_TXT_2WIDTH Set up width ratio as x2 
 LK_TXT_3WIDTH Set up width ratio as x3 
 LK_TXT_4WIDTH Set up width ratio as x4 
 LK_TXT_5WIDTH Set up width ratio as x5 
 LK_TXT_6WIDTH Set up width ratio as x6 
 LK_TXT_7WIDTH Set up width ratio as x7 
 LK_TXT_8WIDTH Set up width ratio as x8
 
 LK_TXT_1HEIGHT Set up height ratio as x1 
 LK_TXT_2HEIGHT Set up height ratio as x2 
 LK_TXT_3HEIGHT Set up height ratio as x3 
 LK_TXT_4HEIGHT Set up height ratio as x4 
 LK_TXT_5HEIGHT Set up height ratio as x5
 LK_TXT_6HEIGHT Set up height ratio as x6 
 LK_TXT_7HEIGHT Set up height ratio as x7 
 LK_TXT_8HEIGHT Set up height ratio as x8
 
Throws:
java.io.UnsupportedEncodingException

printBitmap

public int printBitmap(java.lang.String bitmapName,
                       int alignment)
                throws java.io.IOException
2.6. PrintBitmap

Parameters:
bitmapName - - Unicode string. This value is the bitmap file name
alignment - - This value is alignment. It sets image alignment.
 LK_ALIGNMENT_LEFT Left alignment 
 LK_ALIGNMENT_CENTER Center alignment
 LK_ALIGNMENT_RIGHT Right alignment
 
Returns:
LKPrint.LK_SUCCESS, LKPrint.LK_FAIL
Throws:
java.io.IOException

printBarCode

public void printBarCode(java.lang.String data,
                         int symbology,
                         int height,
                         int width,
                         int alignment,
                         int textPosition)
Parameters:
width - - This values barcode width in Dot Units. It sets total barcode width to print. LK_BCS_3OF5 Print 3 out of 5(KorMail) BarCode LK_BCS_PDF417 Print PDF417 BarCode LK_BCS_MAXICODE Print MAXICODE BarCode LK_BCS_QRCODE Print QrCode BarCode LK_BCS_DATAMATRIX Print DataMatrix BarCode / /** 2.7. PrintBarCode
data - - Unicode string. It sets the barcode data to print.
symbology - - This value is barcode symbol type. It sets barcode type to print.
 LK_BCS_UPCA Print UPC A BarCode 
 LK_BCS_UPCE Print UPC E BarCode
 LK_BCS_EAN8 Print EAN-8 BarCode 
 LK_BCS_EAN13 Print EAN-13 BarCode
 LK_BCS_JAN8 Print JAN-8 BarCode 
 LK_BCS_JAN13 Print JAN-13 BarCode
 LK_BCS_ITF Print Interleaved 2 of 5 
 LK_BCS_Codabar Print Codabar BarCode
 LK_BCS_Code39 Print Code 3 of 9 BarCode 
 LK_BCS_Code93 Print Code 93 BarCode 
 LK_BCS_Code128 Print Code 128 BarCode 
 
height - - This value is barcode height in Dot Units. It sets barcode height to print.
width - - This values fixed barcode width. (2 <= width <= 6)
alignment - - This value is alignment. It sets barcode alignment.
 LK_ALIGNMENT_LEFT Left alignment 
 LK_ALIGNMENT_CENTER Center alignment
 LK_ALIGNMENT_RIGHT Right alignment
 
textPosition - - This value is printing position of barcode HRI letters(barcode data).
 LK_HRI_TEXT_NONE Do not print barcode data 
 LK_HRI_TEXT_ABOVE Print barcode data above the barcode 
 LK_HRI_TEXT_BELOW Print barcode data below the barcode
 

lineFeed

public void lineFeed(int lfCount)
2.8. LineFeed

Parameters:
lfCount - - This value is the number of lines for line feeding. It sets line feeding counter.

printerCheck

public int printerCheck()
2.9. PrinterCheck

Returns:
LK_SUCCESS : This value returns when a function succeeds.

LK_FAIL : This value returns when a function fails.

Throws:
java.io.IOException

status

public int status()
2.10. status

Returns:
LK_STS_NORMAL: Printer Status is No Error and MSR is not Ready.

LK_PAPER_EMPTY : Printer Status is no paper.

LK_COVER_OPEN : Printer Cover is open.

LK_BATTERY_LOW : Printer battery capacity is low.

LK_STS_MSR_READ : Currently MSR in read mode, printing is impossible.


printNVBitmap

public void printNVBitmap(int nvImageNumber)
2.11. PrintNVBitmap

Parameters:
nvImageNumber - - It sets the Number image stored in Flash Memory to print.