com.citizen.jpos.printer
Class ESCPOSPrinter

java.lang.Object
  extended by com.citizen.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
 int getEmulation()
          LK-P20 , LK-P21, LK-P31 µî ¿µ¼öÁõ Àü¿ëÀº Áö¿ø ¾ÈÇÔ.
 void lineFeed(int lfCount)
          2.8.
 void printBarCode(java.lang.String data, int symbology, int height, int width, int alignment, int textPosition)
           
 int printBitmap(android.graphics.Bitmap bitmap, int alignment)
          2.6.
 int printBitmap(java.lang.String bitmapName, int alignment)
          2.6.
 int printBitmap(java.lang.String bitmapName, int alignment, int size)
           
 int printerCheck()
           
 int printerCheck(int timeout)
          2.9.
 void printNormal(java.lang.String data)
          2.3.
 void printNVBitmap(int nvImageNumber)
          2.11.
 void printNVBitmap(int nvImageNumber, int size)
           
 void printPDF417(java.lang.String pdfData, int dataLength, int numberOfColumns, int cellWidth, int alignment)
          2.13.
 void printQRCode(java.lang.String data, int dataLength, int moduleSize, int ecLevel, int alignment)
          2.14.
 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 -
 "ISO-8859-1" (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.
 CMP_ALIGNMENT_LEFT Left alignment 
 CMP_ALIGNMENT_CENTER Center alignment
 CMP_ALIGNMENT_RIGHT Right alignment
 
attribute - - This value is text attributes. It sets text attributes to print.
 CMP_FNT_DEFAULT FontA, Set up as a standard
 CMP_FNT_FONTB Set up as FontB
 CMP_FNT_BOLD Set up as Bold attribute
 CMP_FNT_UNDERLINE Set up as Underline attribute
 
textSize - - This value is text size. It sets text size to print.
 CMP_TXT_1WIDTH Set up width ratio as x1 
 CMP_TXT_2WIDTH Set up width ratio as x2 
 CMP_TXT_3WIDTH Set up width ratio as x3 
 CMP_TXT_4WIDTH Set up width ratio as x4 
 CMP_TXT_5WIDTH Set up width ratio as x5 
 CMP_TXT_6WIDTH Set up width ratio as x6 
 CMP_TXT_7WIDTH Set up width ratio as x7 
 CMP_TXT_8WIDTH Set up width ratio as x8
 
 CMP_TXT_1HEIGHT Set up height ratio as x1 
 CMP_TXT_2HEIGHT Set up height ratio as x2 
 CMP_TXT_3HEIGHT Set up height ratio as x3 
 CMP_TXT_4HEIGHT Set up height ratio as x4 
 CMP_TXT_5HEIGHT Set up height ratio as x5
 CMP_TXT_6HEIGHT Set up height ratio as x6 
 CMP_TXT_7HEIGHT Set up height ratio as x7 
 CMP_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.
 CMP_ALIGNMENT_LEFT Left alignment 
 CMP_ALIGNMENT_CENTER Center alignment
 CMP_ALIGNMENT_RIGHT Right alignment
 
Returns:
CMPPrint.CMP_SUCCESS, CMPPrint.CMP_FAIL
Throws:
java.io.IOException

printBitmap

public int printBitmap(java.lang.String bitmapName,
                       int alignment,
                       int size)
                throws java.io.IOException
Throws:
java.io.IOException

printBitmap

public int printBitmap(android.graphics.Bitmap bitmap,
                       int alignment)
                throws java.io.IOException
2.6. PrintBitmap

Parameters:
bitmap -
alignment -
Returns:
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. CMP_BCS_3OF5 Print 3 out of 5(KorMail) BarCode CMP_BCS_PDF417 Print PDF417 BarCode CMP_BCS_MAXICODE Print MAXICODE BarCode CMP_BCS_QRCODE Print QrCode BarCode CMP_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.
 CMP_BCS_UPCA Print UPC A BarCode 
 CMP_BCS_UPCE Print UPC E BarCode
 CMP_BCS_EAN8 Print EAN-8 BarCode 
 CMP_BCS_EAN13 Print EAN-13 BarCode
 CMP_BCS_JAN8 Print JAN-8 BarCode 
 CMP_BCS_JAN13 Print JAN-13 BarCode
 CMP_BCS_ITF Print Interleaved 2 of 5 
 CMP_BCS_Codabar Print Codabar BarCode
 CMP_BCS_Code39 Print Code 3 of 9 BarCode 
 CMP_BCS_Code93 Print Code 93 BarCode 
 CMP_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.
 CMP_ALIGNMENT_LEFT Left alignment 
 CMP_ALIGNMENT_CENTER Center alignment
 CMP_ALIGNMENT_RIGHT Right alignment
 
textPosition - - This value is printing position of barcode HRI letters(barcode data).
 CMP_HRI_TEXT_NONE Do not print barcode data 
 CMP_HRI_TEXT_ABOVE Print barcode data above the barcode 
 CMP_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(int timeout)
2.9. PrinterCheck

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

CMP_FAIL : This value returns when a function fails.

Throws:
java.io.IOException

printerCheck

public int printerCheck()

status

public int status()
2.10. status

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

CMP_PAPER_EMPTY : Printer Status is no paper.

CMP_COVER_OPEN : Printer Cover is open.

CMP_BATTERY_LOW : Printer battery capacity is low.

CMP_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.

printNVBitmap

public void printNVBitmap(int nvImageNumber,
                          int size)

printPDF417

public void printPDF417(java.lang.String pdfData,
                        int dataLength,
                        int numberOfColumns,
                        int cellWidth,
                        int alignment)
                 throws java.io.UnsupportedEncodingException
2.13. PrintPDF417

Parameters:
pdfData - - It sets the data for PDF417 printing.
dataLength - - It sets the size of data to print PDF417.
numberOfColumns - - It sets the size of Column to print PDF417. (1 ~ 20)
cellWidth - - It sets the size of Cell to print PDF417.
alignment - - It sets the value for PDF417 alignment
 CMP_ALIGNMENT_LEFT Left alignment 
 CMP_ALIGNMENT_CENTER Center alignment 
 CMP_ALIGNMENT_RIGHT Right alignment
 
Throws:
java.io.UnsupportedEncodingException

printQRCode

public void printQRCode(java.lang.String data,
                        int dataLength,
                        int moduleSize,
                        int ecLevel,
                        int alignment)
                 throws java.io.UnsupportedEncodingException
2.14. PrintQRCode

Parameters:
data - - It sets the data for QRCode printing.
dataLength - - It sets the size of data to print QRCode.
moduleSize - - It sets the size of module to print QRCode. (1 ~ 20)
ecLevel - - It sets the Error Correction Level to print QRCode. (0 ~ 3 [Default = 0])
 CMP_QRCODE_EC_LEVEL_L Error Correction Level L(7%)
 CMP_QRCODE_EC_LEVEL_M Error Correction Level M(15%)
 CMP_QRCODE_EC_LEVEL_Q Error Correction Level Q(25%)
 CMP_QRCODE_EC_LEVEL_H Error Correction Level H(30%)
 
alignment - - It sets the value for QRCode alignment
 CMP_ALIGNMENT_LEFT Left alignment
 CMP_ALIGNMENT_CENTER Center alignment
 CMP_ALIGNMENT_RIGHT Right alignment
 
Throws:
java.io.UnsupportedEncodingException

getEmulation

public int getEmulation()
LK-P20 , LK-P21, LK-P31 µî ¿µ¼öÁõ Àü¿ëÀº Áö¿ø ¾ÈÇÔ. Getting the Printers emulation.

Returns: