com.datecs.printers
Class PrinterSDK

java.lang.Object
  extended by com.datecs.printers.PrinterSDK

public final class PrinterSDK
extends java.lang.Object

This is the main class allowing access to the functionality provided by PP-55, PP-60, CMP-10, DPP-250 and DPP-350 printers


Field Summary
static int ALIGN_CENTER
           
static int ALIGN_LEFT
           
static int ALIGN_RIGHT
           
static int BAR_BAR_POSTBAR_CANADA
           
static int BAR_BOOKLAND
           
static int BAR_CODABAR
           
static int BAR_CODE11
           
static int BAR_CODE128
           
static int BAR_CODE32
           
static int BAR_CODE39
           
static int BAR_CODE39_FULLASCII
           
static int BAR_CODE93
           
static int BAR_COMPOSITE
           
static int BAR_COUPON
           
static int BAR_D25
           
static int BAR_DATAMATRIX
           
static int BAR_EAN_128
           
static int BAR_EAN_13
           
static int BAR_EAN_13_PLUS_2
           
static int BAR_EAN_13_PLUS_5
           
static int BAR_EAN_8
           
static int BAR_EAN_8_PLUS_2
           
static int BAR_EAN_8_PLUS_5
           
static int BAR_IATA
           
static int BAR_ISBT_128
           
static int BAR_ISBT_128_CONCATENETED
           
static int BAR_ITF
           
static int BAR_MACROPDF
           
static int BAR_MSI
           
static int BAR_PDF_417
           
static int BAR_POSTAL_AUSTRALIA
           
static int BAR_POSTAL_JAPAN
           
static int BAR_POSTAL_UK
           
static int BAR_POSTNET_US
           
static int BAR_PRN_CODABAR
          Prints CODABAR barcode
static int BAR_PRN_CODE128
          Prints CODE128 barcode
static int BAR_PRN_CODE128AUTO
          Prints CODE128 optimized barcode.
static int BAR_PRN_CODE39
          Prints CODE39 barcode
static int BAR_PRN_CODE93
          Prints CODE93 barcode
static int BAR_PRN_EAN128AUTO
          Prints EAN128 optimized barcode.
static int BAR_PRN_EAN13
          Prints EAN-13 barcode
static int BAR_PRN_EAN8
          Prints EAN-8 barcode
static int BAR_PRN_ITF
          Prints ITF barcode
static int BAR_PRN_PDF417
          Prints 2D PDF-417 barcode
static int BAR_PRN_UPCA
          Prints UPC-A barcode
static int BAR_PRN_UPCE
          Prints UPC-E barcode
static int BAR_QR_CODE
           
static int BAR_RSS_14
           
static int BAR_RSS_EXPANDED
           
static int BAR_RSS_LIMITED
           
static int BAR_SIGNATURE
           
static int BAR_TEXT_ABOVE
           
static int BAR_TEXT_BELOW
           
static int BAR_TEXT_BOTH
           
static int BAR_TEXT_NONE
           
static int BAR_TRIOPTICCODE39
           
static int BAR_UPCA
           
static int BAR_UPCA_PLUS_2
           
static int BAR_UPCA_PLUS_5
           
static int BAR_UPCE
           
static int BAR_UPCE_PLUS_2
           
static int BAR_UPCE_PLUS_5
           
static int BAR_UPCE1
           
static int BAR_UPCE1_PLUS_2
           
static int BAR_UPCE1_PLUS_5
           
static int BLACKMARK_TRESHOLD_DEFAULT
           
static int COLOR_BLACK
           
static int COLOR_INVERSE
           
static int COLOR_WHITE
           
static int FONT_12X24
           
static int FONT_12X48
           
static int FONT_18X16
           
static int FONT_18X32
           
static int FONT_24X24
           
static int FONT_24X48
           
static int FONT_9X16
           
static int FONT_9X32
           
static int FONT_BOLD
           
static int FONT_DEFAULT
           
static int FONT_INVERSE
           
static int FONT_ITALIC
           
static int FONT_PLAIN
           
static int FONT_UNDERLINE
           
static int INFO_BATPERCENT
          Returns printer's battery in percent.
static int INFO_BATVOLT
          Returns printer's battery voltage See getInfo(int)
static int INFO_PAGEHEIGHT
          Returns printer's virtual page height in pixels (203DPI) See getInfo(int) and page mode commands
static int INFO_PAPERWIDTH
          Returns printer's paper width in pixels (203DPI) See getInfo(int)
static int INFO_PRINTERMODEL
          Returns printer's model, one of the PRINTER_* constants See getInfo(int)
static int INFO_PRINTERVERSION
          Returns printer's firmware version See getInfo(int)
static int INFO_TEMPC
          Returns printer's head temperature in Celsius See getInfo(int)
static int INFO_TEMPFR
          Returns printer's head temperature in Fahrenheit See getInfo(int)
static int INTENSITY100
           
static int INTENSITY120
           
static int INTENSITY150
           
static int INTENSITY70
           
static int INTENSITY80
           
static int INTENSITY90
           
static int LINESPACE_DEFAULT
           
static int LOGO_DOUBLEHEIGHT
          Prints the logo at 203x101 DPI See printLogo(int)
static int LOGO_DOUBLEWIDTH
          Prints the logo at 101x203 DPI See printLogo(int)
static int LOGO_DWDH
          Prints the logo at 101x101 DPI See printLogo(int)
static int LOGO_NORMAL
          Prints the logo at 203x203 DPI See printLogo(int)
static int MCU_CARD
          
static int MF_OPERATION_DECREMENT
           
static int MF_OPERATION_INCREMENT
           
static int MF_OPERATION_RESTORE
           
static int MF_STAT_AUTH_ERROR
           
static int MF_STAT_BITCOUNT_ERROR
           
static int MF_STAT_CODE_ERROR
           
static int MF_STAT_COLLISION
           
static int MF_STAT_CRC_ERROR
           
static int MF_STAT_EEPROM_ERROR
           
static int MF_STAT_FIFO_OVERFLOW
           
static int MF_STAT_FRAMING_ERROR
           
static int MF_STAT_INVALID_KEY
           
static int MF_STAT_NOT_AUTH
           
static int MF_STAT_PARITY_ERROR
           
static int MF_STAT_TIMEOUT
          MIFARE STATUS CPDES
static int MF_STAT_UNKNOWN_ERROR
           
static int MF_STAT_VALUE_ERROR
           
static int PAGE_HORIZONTAL_BOTTOMRIGHT
          Horizontal printing, starting from the bottom-right, continuing to the left.
static int PAGE_HORIZONTAL_TOPLEFT
          Horizontal printing, starting from the top-left, continuing to the right.
static int PAGE_VERTICAL_BOTTOMLEFT
          Vertical printing, starting from bottom-left, going upwards, newline goes right
static int PAGE_VERTICAL_TOPRIGHT
          Vertical printing, starting from top-right, going downwards, newline goes left
static int PRINTER_CMP10
           
static int PRINTER_DPP250
           
static int PRINTER_DPP350
           
static int PRINTER_PP50
          Printer types
static int PRINTER_PP55
           
static int PRINTER_PP60
           
static int SCERR_FAILED
           
static int SCERR_FILE_NOT_FOUND
           
static int SCERR_INVALID_LENGTH
           
static int SCERR_NO_FILE_SELECTED
           
static int SCERR_NONE
          SMARTCARD FUNCTIONS RESULT CODES
static int SCERR_RECORD_NOT_FOUND
           
static int TABLE_BORDERS_HORIZONTAL
           
static int TABLE_BORDERS_VERTICAL
           
static int TABLE_COLUMN_COMPACT
           
static int TEXT_ROTATE_0
           
static int TEXT_ROTATE_180
           
static int TEXT_ROTATE_90
           
static int TEXT_WORDWRAP
           
 
Constructor Summary
PrinterSDK()
           
 
Method Summary
 void addPrinterListener(PrinterListener listen_printer)
          Adds a device listener, provides notifications for connect/disconnect/battery events
 java.lang.String barcodeType2Text(int type)
          Helper function to return string name of barcode type
 int calibrateBlackMark()
          Provides blackmark sensor calibration by scaning 200mm of paper for possible black marks and adjust the sensor treshold.
 void checkStatus()
          Check printer status.
 void close()
          Disconnects from the device Call this function to cut the connection to the device.
 void connect()
          Call this function to connect to the device.
 MagneticCardData extractCardData(java.lang.String[] tracks)
          Helper function to extract some common data from magnetic card tracks
 void feedPaper()
          Feeds the paper (different length based on the printer model) so it allows paper to be teared.
 void flush()
          Flushes the caches and forces printing
 int getBlackMarkTreshold()
          Returns blackmark sensor treshold or UnsupportedOperationException if printer is not in blackmark mode.
 int getInfo(int infocmd)
          Returns different information about printer status/settings
 java.lang.String getPrinterSerialNumber()
          Returns printer unique serial number
 void lineFeed()
          Feeds the paper one standard line (34 printer lines at resolution 203DPI)
 void lineFeed(int lines)
          Feeds the paper X lines
 void loadCustomFont(byte[] data, boolean activate)
          Uploads custom font and/or sets the printer to use it.
 void loadLogo(byte[] data)
          Loads logo created by LogoManager into printer memory.
 void mf_AuthByKey(char type, int block, byte[] key)
          Authenticate with mifare card
 void mf_Close()
          Powers down mifare reader module.
 int mf_GetStatus()
          Returns the status of the mifare card
 void mf_Init()
          Initializes and powers on the mifare reader module.
 byte[] mf_Read(int address)
          Reads a 16 byte block of data
 byte[][] mf_RequestCards()
          Scans for mifare cards in the area
 void mf_SelectCard(byte[] serial)
          Selects a card to operate with
 void mf_ValueOperation(int operation, int src_block, int dst_block, long value)
          Performs increment/decrement/restore operations
 void mf_Write(int address, byte[] data)
          Writes a 16 byte block of data
 void mf_WriteValue(int address, long value)
          Writes a 4 byte value in the card
 long mfr_GetSerial()
          Returns mifare reader serial number
 void page_End()
          Exits page mode
 void page_FillRectangle(int color)
          Fills the current working area (or whole page if none is set) with the specified color
 void page_FillRectangle(int left, int top, int width, int height, int color)
          Fills a rectangle inside the current working area with specified color
 boolean page_IsSupported()
          Returns true if page mode is supported
 void page_Print()
          Prints the content of the virtual page.
 void page_PrintTextDirect(int x, int y, int multiplyx, int multiplyy, int flags, java.lang.String text)
           
 void page_RectangleFrame(int left, int top, int width, int height, int framewidth, int color)
          Draws a rectangle frame inside the current working area with specified color
 void page_SetWorkingArea(int left, int top, int width, int height)
          Sets a working area and orientation inside the virtual page.
 void page_SetWorkingArea(int left, int top, int width, int height, int orientation)
          Sets a working area and orientation inside the virtual page.
 void page_Start()
          Creates a new virtual page using the maximum supported page height.
 void printBarcode(int bartype, byte[] barcode)
          Prints barcode
 void printBarcode(int bartype, java.lang.String barcode)
          Prints barcode
 void printBitmap(Bitmap bmp)
          Prints bitmap using pre-calculated data from LogoManager program.
 void printBitmap(int[] argb, int width, int height)
          Prints Bitmap object.
 void printLogo(int m)
          Prints the stored logo.
 void printText(java.lang.String text)
          Prints text with specified font/styles.
 void printTextOld(java.lang.String text, int flags)
          THIS FUNCTION IS FOR COMPATIBILITY WITH THE OLD SDK ONLY!
 java.lang.String[] readCardTracks(int timeout_sec)
          Reads magnetic stripe card
 void removePrinterListener(PrinterListener listen_printer)
          Removes previously added printer listener
 SmartCardReply sc_APDU(int CLA, int INS, int P1, int P2, byte[] data, int offset, int length, int maxlen)
          Sends an APDU command to the smartcard The smartcard have to be operational first by performing #sc_Power and sc_Reset() commands on it
 void sc_Close()
          Powers down the smartcard reader
 void sc_Init()
          Initializes and powers on the smartcard reader Call this function before any other smartcard functions
 byte[] sc_Reset()
          Resets the smartcard and returns Answer To Reset Call this function prior to performing APDU commands
 byte[] scanBarcode()
          Scans barcode using the built-in barcode scanning engine
 void selfTest(boolean longtest)
          Prints selftest
 void setAlign(int align)
          Sets the aligning of printed data, this includes text, barcodes, graphics
 void setBarcodeHeight(int height)
          Sets barcode height
 void setBarcodeScale(int scale)
          Set barcode scale.
 void setBarcodeText(int text)
          Sets the position of the text (HRI Code) of the barcode
 void setBlackMarkTreshold(int treshold)
          Sets blackmark sensor treshold or UnsupportedOperationException if printer is not in blackmark mode.
 void setFont(int size, int style)
          Sets the current font
 void setIntensity(int intensity)
          Sets printint density level
 void setLeftMargin(int margin)
          Sets left margin
 void setLineSpace(int lineSpace)
          Sets the line "height" in pixels If the characters are 16 pixelx high for example, setting the linespace to 20 will make the printer leave 4 blank lines before next line of text starts.
 void setTextRotation(int rotation)
          Set text rotation
 void tbl_AddCell(java.lang.String data)
          Adds a new cell using the font size and style and aligning of the column that cell belongs to
 void tbl_AddCell(java.lang.String data, int font)
          Adds a new cell using the font style and aligning of the column that cell belongs to
 void tbl_AddCell(java.lang.String data, int font, int style)
          Adds a new cell using custom font size and style and aligning of the column that cell belongs to
 void tbl_AddCell(java.lang.String data, int font, int style, int alignment)
          Adds a new cell using custom font size and style and aligning
 void tbl_AddColumn()
          Adds a new column using default settings - 12x24 font, plain, vertical border between the cells, left aligning
 void tbl_AddColumn(int font)
          Adds a new column using default settings - plain text, vertical border between the cells, left aligning
 void tbl_AddColumn(int font, int style, int alignment)
          Adds a new column using custom font and vertical border between the cells
 void tbl_AddColumn(int font, int style, int alignment, int flags)
          Adds a new column
 void tbl_AddDelimiter()
          Adds aa horizontal black line to the entire row that separates it from the next
 void tbl_Create()
          Create a new table using default settings - both horizontal and vertical borders around it
 void tbl_Create(int flags)
          Create a new table using custom flags
 boolean tbl_IsSupported()
          Checks if the currently connected printer supports tables
 void tbl_Print()
          Prints current table or throws IllegalArgumentException if cell data cannot be fit into paper
 void tbl_SetRowHeight(int height)
          Sets the row height that will be used by default for new cells added
 void turnOff()
          Forces printer to turn off
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGO_NORMAL

public static final int LOGO_NORMAL
Prints the logo at 203x203 DPI See printLogo(int)

See Also:
Constant Field Values

LOGO_DOUBLEWIDTH

public static final int LOGO_DOUBLEWIDTH
Prints the logo at 101x203 DPI See printLogo(int)

See Also:
Constant Field Values

LOGO_DOUBLEHEIGHT

public static final int LOGO_DOUBLEHEIGHT
Prints the logo at 203x101 DPI See printLogo(int)

See Also:
Constant Field Values

LOGO_DWDH

public static final int LOGO_DWDH
Prints the logo at 101x101 DPI See printLogo(int)

See Also:
Constant Field Values

INFO_BATVOLT

public static final int INFO_BATVOLT
Returns printer's battery voltage See getInfo(int)

See Also:
Constant Field Values

INFO_BATPERCENT

public static final int INFO_BATPERCENT
Returns printer's battery in percent. Note that due to the way battery discharge, this information is not 100% accurate. See getInfo(int)

See Also:
Constant Field Values

INFO_TEMPC

public static final int INFO_TEMPC
Returns printer's head temperature in Celsius See getInfo(int)

See Also:
Constant Field Values

INFO_TEMPFR

public static final int INFO_TEMPFR
Returns printer's head temperature in Fahrenheit See getInfo(int)

See Also:
Constant Field Values

INFO_PRINTERVERSION

public static final int INFO_PRINTERVERSION
Returns printer's firmware version See getInfo(int)

See Also:
Constant Field Values

INFO_PRINTERMODEL

public static final int INFO_PRINTERMODEL
Returns printer's model, one of the PRINTER_* constants See getInfo(int)

See Also:
Constant Field Values

INFO_PAPERWIDTH

public static final int INFO_PAPERWIDTH
Returns printer's paper width in pixels (203DPI) See getInfo(int)

See Also:
Constant Field Values

INFO_PAGEHEIGHT

public static final int INFO_PAGEHEIGHT
Returns printer's virtual page height in pixels (203DPI) See getInfo(int) and page mode commands

See Also:
Constant Field Values

PRINTER_PP50

public static final int PRINTER_PP50
Printer types

See Also:
Constant Field Values

PRINTER_PP55

public static final int PRINTER_PP55
See Also:
Constant Field Values

PRINTER_CMP10

public static final int PRINTER_CMP10
See Also:
Constant Field Values

PRINTER_DPP350

public static final int PRINTER_DPP350
See Also:
Constant Field Values

PRINTER_DPP250

public static final int PRINTER_DPP250
See Also:
Constant Field Values

PRINTER_PP60

public static final int PRINTER_PP60
See Also:
Constant Field Values

MCU_CARD

public static final int MCU_CARD

See Also:
Constant Field Values

SCERR_NONE

public static final int SCERR_NONE
SMARTCARD FUNCTIONS RESULT CODES

See Also:
Constant Field Values

SCERR_FAILED

public static final int SCERR_FAILED
See Also:
Constant Field Values

SCERR_FILE_NOT_FOUND

public static final int SCERR_FILE_NOT_FOUND
See Also:
Constant Field Values

SCERR_RECORD_NOT_FOUND

public static final int SCERR_RECORD_NOT_FOUND
See Also:
Constant Field Values

SCERR_INVALID_LENGTH

public static final int SCERR_INVALID_LENGTH
See Also:
Constant Field Values

SCERR_NO_FILE_SELECTED

public static final int SCERR_NO_FILE_SELECTED
See Also:
Constant Field Values

BAR_PRN_UPCA

public static final int BAR_PRN_UPCA
Prints UPC-A barcode

See Also:
Constant Field Values

BAR_PRN_UPCE

public static final int BAR_PRN_UPCE
Prints UPC-E barcode

See Also:
Constant Field Values

BAR_PRN_EAN13

public static final int BAR_PRN_EAN13
Prints EAN-13 barcode

See Also:
Constant Field Values

BAR_PRN_EAN8

public static final int BAR_PRN_EAN8
Prints EAN-8 barcode

See Also:
Constant Field Values

BAR_PRN_CODE39

public static final int BAR_PRN_CODE39
Prints CODE39 barcode

See Also:
Constant Field Values

BAR_PRN_ITF

public static final int BAR_PRN_ITF
Prints ITF barcode

See Also:
Constant Field Values

BAR_PRN_CODABAR

public static final int BAR_PRN_CODABAR
Prints CODABAR barcode

See Also:
Constant Field Values

BAR_PRN_CODE93

public static final int BAR_PRN_CODE93
Prints CODE93 barcode

See Also:
Constant Field Values

BAR_PRN_CODE128

public static final int BAR_PRN_CODE128
Prints CODE128 barcode

See Also:
Constant Field Values

BAR_PRN_PDF417

public static final int BAR_PRN_PDF417
Prints 2D PDF-417 barcode

See Also:
Constant Field Values

BAR_PRN_CODE128AUTO

public static final int BAR_PRN_CODE128AUTO
Prints CODE128 optimized barcode. Supported only on DPP-350 and DPP-250 printers, it makes the barcode lot smaller especially when numbers only are used

See Also:
Constant Field Values

BAR_PRN_EAN128AUTO

public static final int BAR_PRN_EAN128AUTO
Prints EAN128 optimized barcode. Supported only on DPP-350 and DPP-250 printers, it makes the barcode lot smaller especially when numbers only are used

See Also:
Constant Field Values

BAR_TEXT_NONE

public static final int BAR_TEXT_NONE
See Also:
Constant Field Values

BAR_TEXT_ABOVE

public static final int BAR_TEXT_ABOVE
See Also:
Constant Field Values

BAR_TEXT_BELOW

public static final int BAR_TEXT_BELOW
See Also:
Constant Field Values

BAR_TEXT_BOTH

public static final int BAR_TEXT_BOTH
See Also:
Constant Field Values

BAR_BOOKLAND

public static final int BAR_BOOKLAND
See Also:
Constant Field Values

BAR_CODABAR

public static final int BAR_CODABAR
See Also:
Constant Field Values

BAR_CODE11

public static final int BAR_CODE11
See Also:
Constant Field Values

BAR_CODE32

public static final int BAR_CODE32
See Also:
Constant Field Values

BAR_CODE128

public static final int BAR_CODE128
See Also:
Constant Field Values

BAR_CODE39

public static final int BAR_CODE39
See Also:
Constant Field Values

BAR_CODE39_FULLASCII

public static final int BAR_CODE39_FULLASCII
See Also:
Constant Field Values

BAR_CODE93

public static final int BAR_CODE93
See Also:
Constant Field Values

BAR_COMPOSITE

public static final int BAR_COMPOSITE
See Also:
Constant Field Values

BAR_COUPON

public static final int BAR_COUPON
See Also:
Constant Field Values

BAR_D25

public static final int BAR_D25
See Also:
Constant Field Values

BAR_DATAMATRIX

public static final int BAR_DATAMATRIX
See Also:
Constant Field Values

BAR_EAN_128

public static final int BAR_EAN_128
See Also:
Constant Field Values

BAR_EAN_13

public static final int BAR_EAN_13
See Also:
Constant Field Values

BAR_EAN_13_PLUS_2

public static final int BAR_EAN_13_PLUS_2
See Also:
Constant Field Values

BAR_EAN_13_PLUS_5

public static final int BAR_EAN_13_PLUS_5
See Also:
Constant Field Values

BAR_EAN_8

public static final int BAR_EAN_8
See Also:
Constant Field Values

BAR_EAN_8_PLUS_2

public static final int BAR_EAN_8_PLUS_2
See Also:
Constant Field Values

BAR_EAN_8_PLUS_5

public static final int BAR_EAN_8_PLUS_5
See Also:
Constant Field Values

BAR_IATA

public static final int BAR_IATA
See Also:
Constant Field Values

BAR_ISBT_128

public static final int BAR_ISBT_128
See Also:
Constant Field Values

BAR_ISBT_128_CONCATENETED

public static final int BAR_ISBT_128_CONCATENETED
See Also:
Constant Field Values

BAR_ITF

public static final int BAR_ITF
See Also:
Constant Field Values

BAR_MACROPDF

public static final int BAR_MACROPDF
See Also:
Constant Field Values

BAR_MSI

public static final int BAR_MSI
See Also:
Constant Field Values

BAR_PDF_417

public static final int BAR_PDF_417
See Also:
Constant Field Values

BAR_BAR_POSTBAR_CANADA

public static final int BAR_BAR_POSTBAR_CANADA
See Also:
Constant Field Values

BAR_POSTNET_US

public static final int BAR_POSTNET_US
See Also:
Constant Field Values

BAR_POSTAL_AUSTRALIA

public static final int BAR_POSTAL_AUSTRALIA
See Also:
Constant Field Values

BAR_POSTAL_JAPAN

public static final int BAR_POSTAL_JAPAN
See Also:
Constant Field Values

BAR_POSTAL_UK

public static final int BAR_POSTAL_UK
See Also:
Constant Field Values

BAR_QR_CODE

public static final int BAR_QR_CODE
See Also:
Constant Field Values

BAR_RSS_LIMITED

public static final int BAR_RSS_LIMITED
See Also:
Constant Field Values

BAR_RSS_14

public static final int BAR_RSS_14
See Also:
Constant Field Values

BAR_RSS_EXPANDED

public static final int BAR_RSS_EXPANDED
See Also:
Constant Field Values

BAR_SIGNATURE

public static final int BAR_SIGNATURE
See Also:
Constant Field Values

BAR_TRIOPTICCODE39

public static final int BAR_TRIOPTICCODE39
See Also:
Constant Field Values

BAR_UPCA

public static final int BAR_UPCA
See Also:
Constant Field Values

BAR_UPCA_PLUS_2

public static final int BAR_UPCA_PLUS_2
See Also:
Constant Field Values

BAR_UPCA_PLUS_5

public static final int BAR_UPCA_PLUS_5
See Also:
Constant Field Values

BAR_UPCE

public static final int BAR_UPCE
See Also:
Constant Field Values

BAR_UPCE_PLUS_2

public static final int BAR_UPCE_PLUS_2
See Also:
Constant Field Values

BAR_UPCE_PLUS_5

public static final int BAR_UPCE_PLUS_5
See Also:
Constant Field Values

BAR_UPCE1

public static final int BAR_UPCE1
See Also:
Constant Field Values

BAR_UPCE1_PLUS_2

public static final int BAR_UPCE1_PLUS_2
See Also:
Constant Field Values

BAR_UPCE1_PLUS_5

public static final int BAR_UPCE1_PLUS_5
See Also:
Constant Field Values

MF_STAT_TIMEOUT

public static final int MF_STAT_TIMEOUT
MIFARE STATUS CPDES

See Also:
Constant Field Values

MF_STAT_COLLISION

public static final int MF_STAT_COLLISION
See Also:
Constant Field Values

MF_STAT_PARITY_ERROR

public static final int MF_STAT_PARITY_ERROR
See Also:
Constant Field Values

MF_STAT_FRAMING_ERROR

public static final int MF_STAT_FRAMING_ERROR
See Also:
Constant Field Values

MF_STAT_CRC_ERROR

public static final int MF_STAT_CRC_ERROR
See Also:
Constant Field Values

MF_STAT_FIFO_OVERFLOW

public static final int MF_STAT_FIFO_OVERFLOW
See Also:
Constant Field Values

MF_STAT_EEPROM_ERROR

public static final int MF_STAT_EEPROM_ERROR
See Also:
Constant Field Values

MF_STAT_INVALID_KEY

public static final int MF_STAT_INVALID_KEY
See Also:
Constant Field Values

MF_STAT_UNKNOWN_ERROR

public static final int MF_STAT_UNKNOWN_ERROR
See Also:
Constant Field Values

MF_STAT_AUTH_ERROR

public static final int MF_STAT_AUTH_ERROR
See Also:
Constant Field Values

MF_STAT_CODE_ERROR

public static final int MF_STAT_CODE_ERROR
See Also:
Constant Field Values

MF_STAT_BITCOUNT_ERROR

public static final int MF_STAT_BITCOUNT_ERROR
See Also:
Constant Field Values

MF_STAT_NOT_AUTH

public static final int MF_STAT_NOT_AUTH
See Also:
Constant Field Values

MF_STAT_VALUE_ERROR

public static final int MF_STAT_VALUE_ERROR
See Also:
Constant Field Values

MF_OPERATION_INCREMENT

public static final int MF_OPERATION_INCREMENT
See Also:
Constant Field Values

MF_OPERATION_DECREMENT

public static final int MF_OPERATION_DECREMENT
See Also:
Constant Field Values

MF_OPERATION_RESTORE

public static final int MF_OPERATION_RESTORE
See Also:
Constant Field Values

INTENSITY70

public static final int INTENSITY70
See Also:
Constant Field Values

INTENSITY80

public static final int INTENSITY80
See Also:
Constant Field Values

INTENSITY90

public static final int INTENSITY90
See Also:
Constant Field Values

INTENSITY100

public static final int INTENSITY100
See Also:
Constant Field Values

INTENSITY120

public static final int INTENSITY120
See Also:
Constant Field Values

INTENSITY150

public static final int INTENSITY150
See Also:
Constant Field Values

FONT_9X16

public static final int FONT_9X16
See Also:
Constant Field Values

FONT_18X16

public static final int FONT_18X16
See Also:
Constant Field Values

FONT_9X32

public static final int FONT_9X32
See Also:
Constant Field Values

FONT_18X32

public static final int FONT_18X32
See Also:
Constant Field Values

FONT_12X24

public static final int FONT_12X24
See Also:
Constant Field Values

FONT_24X24

public static final int FONT_24X24
See Also:
Constant Field Values

FONT_12X48

public static final int FONT_12X48
See Also:
Constant Field Values

FONT_24X48

public static final int FONT_24X48
See Also:
Constant Field Values

FONT_DEFAULT

public static final int FONT_DEFAULT
See Also:
Constant Field Values

FONT_PLAIN

public static final int FONT_PLAIN
See Also:
Constant Field Values

FONT_BOLD

public static final int FONT_BOLD
See Also:
Constant Field Values

FONT_ITALIC

public static final int FONT_ITALIC
See Also:
Constant Field Values

FONT_UNDERLINE

public static final int FONT_UNDERLINE
See Also:
Constant Field Values

FONT_INVERSE

public static final int FONT_INVERSE
See Also:
Constant Field Values

ALIGN_LEFT

public static final int ALIGN_LEFT
See Also:
Constant Field Values

ALIGN_CENTER

public static final int ALIGN_CENTER
See Also:
Constant Field Values

ALIGN_RIGHT

public static final int ALIGN_RIGHT
See Also:
Constant Field Values

TEXT_WORDWRAP

public static final int TEXT_WORDWRAP
See Also:
Constant Field Values

TEXT_ROTATE_0

public static final int TEXT_ROTATE_0
See Also:
Constant Field Values

TEXT_ROTATE_90

public static final int TEXT_ROTATE_90
See Also:
Constant Field Values

TEXT_ROTATE_180

public static final int TEXT_ROTATE_180
See Also:
Constant Field Values

LINESPACE_DEFAULT

public static final int LINESPACE_DEFAULT
See Also:
Constant Field Values

BLACKMARK_TRESHOLD_DEFAULT

public static final int BLACKMARK_TRESHOLD_DEFAULT
See Also:
Constant Field Values

TABLE_BORDERS_HORIZONTAL

public static final int TABLE_BORDERS_HORIZONTAL
See Also:
Constant Field Values

TABLE_BORDERS_VERTICAL

public static final int TABLE_BORDERS_VERTICAL
See Also:
Constant Field Values

TABLE_COLUMN_COMPACT

public static final int TABLE_COLUMN_COMPACT
See Also:
Constant Field Values

PAGE_HORIZONTAL_TOPLEFT

public static final int PAGE_HORIZONTAL_TOPLEFT
Horizontal printing, starting from the top-left, continuing to the right. Newline goes down

See Also:
Constant Field Values

PAGE_VERTICAL_BOTTOMLEFT

public static final int PAGE_VERTICAL_BOTTOMLEFT
Vertical printing, starting from bottom-left, going upwards, newline goes right

See Also:
Constant Field Values

PAGE_HORIZONTAL_BOTTOMRIGHT

public static final int PAGE_HORIZONTAL_BOTTOMRIGHT
Horizontal printing, starting from the bottom-right, continuing to the left. Newline goes up

See Also:
Constant Field Values

PAGE_VERTICAL_TOPRIGHT

public static final int PAGE_VERTICAL_TOPRIGHT
Vertical printing, starting from top-right, going downwards, newline goes left

See Also:
Constant Field Values

COLOR_WHITE

public static final int COLOR_WHITE
See Also:
Constant Field Values

COLOR_BLACK

public static final int COLOR_BLACK
See Also:
Constant Field Values

COLOR_INVERSE

public static final int COLOR_INVERSE
See Also:
Constant Field Values
Constructor Detail

PrinterSDK

public PrinterSDK()
Method Detail

printBitmap

public void printBitmap(Bitmap bmp)
Prints bitmap using pre-calculated data from LogoManager program. Generally this is lot faster on older devices, but limited in usability

Parameters:
bmp - bitmap data

printTextOld

public void printTextOld(java.lang.String text,
                         int flags)
                  throws java.io.IOException
THIS FUNCTION IS FOR COMPATIBILITY WITH THE OLD SDK ONLY! Prints text with specified font/styles. This function can act as both simple plain text printing and quite complex printing using internal tags to format the text. The function uses the currently font size and style (or default ones) as well as the aligning, however it allows modifications of them inside the text. Any modification of the settings using the tags will be reverted when function completes execution. For example if you have default font selected before using printText and set bold font inside, it will be reverted to plain when function completes. The tags are control commands used to modify the text printing parameters. They are surrounded by {} brackets. A list of all control tags follows:

An example of using tags "{=C}Plain centered text\n{=L}Left centered\n{+B}...bold...{-B}{+I}or ITALIC"

Parameters:
text - the text to be printed. This can be either plain text, or text with formatting inside. Formatting sequences can be used in any combination to achieve the effect needed
flags - used to set function parameters, any combination of the following:
  • 0: Select left alignment
  • 0: Sets big font
  • 1: Turns on italic font
  • 2: Turns on bold font
  • 4: Turns on underlined font
  • 8: Turns on doublewidth font
  • 16: Turns on doubleheight font
  • 32: Turns on rotated (90°) font
  • 64: Turns on reversed (180°) font
  • 256: Select center alignment
  • 512: Select right alignment
  • 1024: Sets small font
  • 4096: Turns on text wordwrapping
    Throws:
    java.io.IOException

  • connect

    public void connect()
    Call this function to connect to the device. In oreder to be notified before, add listeners first


    addPrinterListener

    public void addPrinterListener(PrinterListener listen_printer)
    Adds a device listener, provides notifications for connect/disconnect/battery events


    removePrinterListener

    public void removePrinterListener(PrinterListener listen_printer)
    Removes previously added printer listener


    close

    public void close()
    Disconnects from the device Call this function to cut the connection to the device. The cached data still not sent will be lost. Use flush() to force data to be sent to the printer


    flush

    public void flush()
               throws java.io.IOException
    Flushes the caches and forces printing

    Throws:
    java.io.IOException

    checkStatus

    public void checkStatus()
                     throws java.io.IOException
    Check printer status. The listener is called if some status have changed from last time

    Throws:
    java.io.IOException

    selfTest

    public void selfTest(boolean longtest)
                  throws java.io.IOException
    Prints selftest

    Parameters:
    longtest - true if you want complete test with fonts and codepage, false for short one
    Throws:
    java.io.IOException

    turnOff

    public void turnOff()
                 throws java.io.IOException
    Forces printer to turn off

    Throws:
    java.io.IOException

    lineFeed

    public void lineFeed()
                  throws java.io.IOException
    Feeds the paper one standard line (34 printer lines at resolution 203DPI)

    Throws:
    java.io.IOException

    lineFeed

    public void lineFeed(int lines)
                  throws java.io.IOException,
                         java.lang.IllegalArgumentException
    Feeds the paper X lines

    Parameters:
    lines - number of lines to feed at resolution 203DPI
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    feedPaper

    public void feedPaper()
                   throws java.io.IOException
    Feeds the paper (different length based on the printer model) so it allows paper to be teared. NOTE: If blackmark mode is active, this function searches for blackmark. If the paper is not blackmark one or the mark can not be found in 360mm, the printer will put itself into out of paper state and will need LF button to be pushed to continue.

    Throws:
    java.io.IOException

    printBarcode

    public void printBarcode(int bartype,
                             java.lang.String barcode)
                      throws java.io.IOException
    Prints barcode

    Parameters:
    bartype - Barcode type, one of the BAR_PRN_* constants
    barcode - barcode data to be printed
    Throws:
    java.io.IOException

    printBarcode

    public void printBarcode(int bartype,
                             byte[] barcode)
                      throws java.io.IOException,
                             java.lang.IllegalArgumentException
    Prints barcode

    Parameters:
    bartype - Barcode type, one of the BAR_PRN_* constants
    barcode - barcode data to be printed
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    printLogo

    public void printLogo(int m)
                   throws java.io.IOException,
                          java.lang.IllegalArgumentException
    Prints the stored logo. You can upload log with loadLogo(byte[]) function

    Parameters:
    m - logo mode, one of the LOGO_* constants
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    setAlign

    public void setAlign(int align)
                  throws java.io.IOException,
                         java.lang.IllegalArgumentException
    Sets the aligning of printed data, this includes text, barcodes, graphics

    Parameters:
    align - text align, one of the ALIGN_* constants
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    setTextRotation

    public void setTextRotation(int rotation)
                         throws java.io.IOException,
                                java.lang.IllegalArgumentException
    Set text rotation

    Parameters:
    rotation - text rotation, one of the TEXT_ROTATE_* constants
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    setBarcodeScale

    public void setBarcodeScale(int scale)
                         throws java.lang.IllegalArgumentException
    Set barcode scale. It is actually the width in pixes of each column

    Parameters:
    scale - width of each barcode column. Between 2 and 4, default is 3
    Throws:
    java.lang.IllegalArgumentException

    setBarcodeHeight

    public void setBarcodeHeight(int height)
                          throws java.lang.IllegalArgumentException
    Sets barcode height

    Parameters:
    height - barcode height in pixels between 1 and 255. Default is 77
    Throws:
    java.lang.IllegalArgumentException

    setBarcodeText

    public void setBarcodeText(int text)
                        throws java.lang.IllegalArgumentException
    Sets the position of the text (HRI Code) of the barcode

    Parameters:
    text - barcode hri code position, one of the BAR_TEXT_* constants
    Throws:
    java.lang.IllegalArgumentException

    setIntensity

    public void setIntensity(int intensity)
                      throws java.io.IOException,
                             java.lang.IllegalArgumentException
    Sets printint density level

    Parameters:
    intensity - intensity level, one of the INTENSITY* constants
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    setFont

    public void setFont(int size,
                        int style)
                 throws java.io.IOException,
                        java.lang.IllegalArgumentException
    Sets the current font

    Parameters:
    size - font size, one of the FONT_HxV constants
    style - font style, a bitwise OR of any of the FONT_* constants
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    setLineSpace

    public void setLineSpace(int lineSpace)
                      throws java.io.IOException,
                             java.lang.IllegalArgumentException
    Sets the line "height" in pixels If the characters are 16 pixelx high for example, setting the linespace to 20 will make the printer leave 4 blank lines before next line of text starts. You cannot make text lines overlap.

    Parameters:
    lineSpace - linespace in pixels, or 0 for automatic calculation. Default is 0
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    setLeftMargin

    public void setLeftMargin(int margin)
                       throws java.io.IOException,
                              java.lang.IllegalArgumentException
    Sets left margin

    Parameters:
    margin - left margin in pixels. Default is 0
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    printText

    public void printText(java.lang.String text)
                   throws java.io.IOException
    Prints text with specified font/styles. This function can act as both simple plain text printing and quite complex printing using internal tags to format the text. The function uses the currently font size and style (or default ones) as well as the aligning, however it allows modifications of them inside the text. Any modification of the settings using the tags will be reverted when function completes execution. For example if you have default font selected before using printText and set bold font inside, it will be reverted to plain when function completes. The tags are control commands used to modify the text printing parameters. They are surrounded by {} brackets. A list of all control tags follows:

    An example of using tags "{=C}Plain centered text\n{=L}Left centered\n{+B}...bold...{-B}{+I}or ITALIC"

    Parameters:
    text - the text to be printed. This can be either plain text, or text with formatting inside. Formatting sequences can be used in any combination to achieve the effect needed
    Throws:
    java.io.IOException

    getInfo

    public int getInfo(int infocmd)
                throws java.io.IOException,
                       java.lang.IllegalArgumentException
    Returns different information about printer status/settings

    Parameters:
    infocmd - information type requested, one of the INFO_* constants
    Returns:
    the answer specific to the infocmd command
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    getPrinterSerialNumber

    public java.lang.String getPrinterSerialNumber()
                                            throws java.io.IOException,
                                                   java.lang.UnsupportedOperationException
    Returns printer unique serial number

    Returns:
    serial number
    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException

    loadCustomFont

    public void loadCustomFont(byte[] data,
                               boolean activate)
                        throws java.io.IOException,
                               java.lang.IllegalArgumentException
    Uploads custom font and/or sets the printer to use it. The font is stored in printer's memory and is persistent. Only battery removal or several months of standby can erase it. Usually custom font is used when you want to print using charset of

    Parameters:
    data - font data created by FontManager. Pass null if you want to just activate/deactivate the custom font
    activate - true if you want to print using the custom font, false to use the built-in
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    getBlackMarkTreshold

    public int getBlackMarkTreshold()
                             throws java.io.IOException,
                                    java.lang.UnsupportedOperationException
    Returns blackmark sensor treshold or UnsupportedOperationException if printer is not in blackmark mode. This value tells the printer how dark a spot on the paper needs to be in order to be considered as blackmark.

    Parameters:
    treshold - value between 0x20 and 0xc0, default is 0x68
    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException

    setBlackMarkTreshold

    public void setBlackMarkTreshold(int treshold)
                              throws java.io.IOException,
                                     java.lang.UnsupportedOperationException,
                                     java.lang.IllegalArgumentException
    Sets blackmark sensor treshold or UnsupportedOperationException if printer is not in blackmark mode. This value tells the printer how dark a spot on the paper needs to be in order to be considered as blackmark.

    Parameters:
    treshold - value between 0x20 and 0xc0, default is 0x68
    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException
    java.lang.IllegalArgumentException

    calibrateBlackMark

    public int calibrateBlackMark()
                           throws java.io.IOException,
                                  java.lang.UnsupportedOperationException
    Provides blackmark sensor calibration by scaning 200mm of paper for possible black marks and adjust the sensor treshold. Make sure you have put the right paper before calling this function.

    Returns:
    returns new trashold value for the scanned paper. The trashold is already stored in printer's flash memory so no additional set is needed.
    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException

    page_IsSupported

    public boolean page_IsSupported()
    Returns true if page mode is supported


    page_Start

    public void page_Start()
                    throws java.io.IOException,
                           java.lang.UnsupportedOperationException
    Creates a new virtual page using the maximum supported page height. Use getInfo(int) to get the maximum page height supported. See #page_Start(int height) for more detailed information The page mode allows constructing a virtual page inside the printer, draw text, graphics, and performs some basic graphics operations (draw rectangles, frames, invert parts of the page) at any place, rotated or not, then print the result. Page mode is useful if you want to create some non-standart printout, or print vertically. Tables functions also work in page mode allowing a huge tables to be created and printed vertically.

    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException

    page_Print

    public void page_Print()
                    throws java.io.IOException,
                           java.lang.UnsupportedOperationException
    Prints the content of the virtual page. Note that the white space from the top and bottom is not printed so the print ends at the last black dot. If you want to feed the paper use the lineFeed(int lines) function

    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException

    page_End

    public void page_End()
                  throws java.io.IOException,
                         java.lang.UnsupportedOperationException
    Exits page mode

    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException

    page_SetWorkingArea

    public void page_SetWorkingArea(int left,
                                    int top,
                                    int width,
                                    int height)
                             throws java.io.IOException,
                                    java.lang.UnsupportedOperationException,
                                    java.lang.IllegalArgumentException
    Sets a working area and orientation inside the virtual page. No drawing can ever occur outside the said area

    Parameters:
    left, - top, width, height working area rectangle in absolute pixels (i.e. does not depend on the page orientation)
    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException
    java.lang.IllegalArgumentException

    page_SetWorkingArea

    public void page_SetWorkingArea(int left,
                                    int top,
                                    int width,
                                    int height,
                                    int orientation)
                             throws java.io.IOException,
                                    java.lang.UnsupportedOperationException,
                                    java.lang.IllegalArgumentException
    Sets a working area and orientation inside the virtual page. No drawing can ever occur outside the said area

    Parameters:
    left, - top, width, height working area rectangle in absolute pixels (i.e. does not depend on the page orientation)
    orientation - one of the PAGE_* constants
    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException
    java.lang.IllegalArgumentException

    page_FillRectangle

    public void page_FillRectangle(int color)
                            throws java.io.IOException,
                                   java.lang.UnsupportedOperationException,
                                   java.lang.IllegalArgumentException
    Fills the current working area (or whole page if none is set) with the specified color

    Parameters:
    color - one of the COLOR_* constants
    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException
    java.lang.IllegalArgumentException

    page_FillRectangle

    public void page_FillRectangle(int left,
                                   int top,
                                   int width,
                                   int height,
                                   int color)
                            throws java.io.IOException,
                                   java.lang.UnsupportedOperationException,
                                   java.lang.IllegalArgumentException
    Fills a rectangle inside the current working area with specified color

    Parameters:
    left, - top, width, height rectangle coordinates
    color - one of the COLOR_* constants
    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException
    java.lang.IllegalArgumentException

    page_RectangleFrame

    public void page_RectangleFrame(int left,
                                    int top,
                                    int width,
                                    int height,
                                    int framewidth,
                                    int color)
                             throws java.io.IOException,
                                    java.lang.UnsupportedOperationException,
                                    java.lang.IllegalArgumentException
    Draws a rectangle frame inside the current working area with specified color

    Parameters:
    left, - top, width, height rectangle coordinates
    framewidth - width of the frame (1-64)
    color - one of the COLOR_* constants
    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException
    java.lang.IllegalArgumentException

    page_PrintTextDirect

    public void page_PrintTextDirect(int x,
                                     int y,
                                     int multiplyx,
                                     int multiplyy,
                                     int flags,
                                     java.lang.String text)
                              throws java.io.IOException,
                                     java.lang.UnsupportedOperationException,
                                     java.lang.IllegalArgumentException
    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException
    java.lang.IllegalArgumentException

    barcodeType2Text

    public java.lang.String barcodeType2Text(int type)
    Helper function to return string name of barcode type

    Parameters:
    type - barcode type returned from scanBarcode()
    Returns:
    barcode type name

    scanBarcode

    public byte[] scanBarcode()
                       throws java.io.IOException,
                              java.lang.UnsupportedOperationException
    Scans barcode using the built-in barcode scanning engine

    Returns:
    byte array consisting of barcode type in the first byte and barcode data following. Returns null if timeout elapsed
    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException

    readCardTracks

    public java.lang.String[] readCardTracks(int timeout_sec)
                                      throws java.io.IOException,
                                             java.lang.UnsupportedOperationException
    Reads magnetic stripe card

    Parameters:
    timeout_sec - timeout in seconds to read the card data. The actuall scan time may differ, but will be as close as possible to this value
    Returns:
    String[3] containing the 3 tracks or null if timeout elapses
    Throws:
    java.io.IOException
    java.lang.UnsupportedOperationException

    extractCardData

    public MagneticCardData extractCardData(java.lang.String[] tracks)
    Helper function to extract some common data from magnetic card tracks

    Parameters:
    tracks - the string array as returned from readCardTracks(int)
    Returns:
    a structure containing data extracted such as name, number, expiration date

    loadLogo

    public void loadLogo(byte[] data)
                  throws java.io.IOException,
                         java.lang.IllegalArgumentException
    Loads logo created by LogoManager into printer memory. The logo is persistent and can be deleted only if battery is removed

    Parameters:
    data - logo bitmap data
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    printBitmap

    public void printBitmap(int[] argb,
                            int width,
                            int height)
                     throws java.io.IOException,
                            java.lang.IllegalArgumentException
    Prints Bitmap object. You can print color bitmaps, as they will be converted to black and white using error diffusion and dithering to achieve best results. On older devices this can take some time

    Parameters:
    bmp - Bitmap object
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    sc_Init

    public void sc_Init()
                 throws java.io.IOException
    Initializes and powers on the smartcard reader Call this function before any other smartcard functions

    Throws:
    java.io.IOException

    sc_Close

    public void sc_Close()
                  throws java.io.IOException
    Powers down the smartcard reader

    Throws:
    java.io.IOException

    sc_Reset

    public byte[] sc_Reset()
                    throws java.io.IOException
    Resets the smartcard and returns Answer To Reset Call this function prior to performing APDU commands

    Returns:
    first byte is the protocol number (0=T0, 1=T1), the rest is ATR(Answer To Reset) data
    Throws:
    java.io.IOException

    sc_APDU

    public SmartCardReply sc_APDU(int CLA,
                                  int INS,
                                  int P1,
                                  int P2,
                                  byte[] data,
                                  int offset,
                                  int length,
                                  int maxlen)
                           throws java.io.IOException,
                                  java.lang.IllegalArgumentException
    Sends an APDU command to the smartcard The smartcard have to be operational first by performing #sc_Power and sc_Reset() commands on it

    Parameters:
    CLA - The CLA parameter byte
    INS - The INS parameter byte
    P1 - The P1 parameter byte
    P2 - The P2 parameter byte
    data - The data buffer you want to send with the command, optional, can be null
    offset - Offset inside the data buffer
    length - Lenght of the data
    maxlen - Defines the maximum number of bytes you want to receive from the smartcard. Defaults to 0
    Returns:
    SmartCard Response struct
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    mf_GetStatus

    public int mf_GetStatus()
    Returns the status of the mifare card

    Returns:
    mifare card status. If the status is -1, then an error has occured

    mf_Init

    public void mf_Init()
                 throws java.io.IOException
    Initializes and powers on the mifare reader module. Call this function before any other mifare functions.

    Throws:
    java.io.IOException

    mf_Close

    public void mf_Close()
                  throws java.io.IOException
    Powers down mifare reader module. Call this function after you are done with the mifare reader.

    Throws:
    java.io.IOException

    mf_RequestCards

    public byte[][] mf_RequestCards()
                             throws java.io.IOException
    Scans for mifare cards in the area

    Returns:
    array of mifare cards serial numbers or null if none are detected
    Throws:
    java.io.IOException

    mf_SelectCard

    public void mf_SelectCard(byte[] serial)
                       throws java.io.IOException,
                              java.lang.IllegalArgumentException
    Selects a card to operate with

    Parameters:
    serial - one of the serial numbers returned by mf_RequestCards()
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    mf_AuthByKey

    public void mf_AuthByKey(char type,
                             int block,
                             byte[] key)
                      throws java.io.IOException,
                             java.lang.IllegalArgumentException
    Authenticate with mifare card

    Parameters:
    type - key type, either 'A' or 'B'
    block - block number
    key - 6 bytes key
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    mf_Read

    public byte[] mf_Read(int address)
                   throws java.io.IOException,
                          java.lang.IllegalArgumentException
    Reads a 16 byte block of data

    Parameters:
    address - the address of what to read
    Returns:
    16 bytes block of data
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    mf_Write

    public void mf_Write(int address,
                         byte[] data)
                  throws java.io.IOException,
                         java.lang.IllegalArgumentException
    Writes a 16 byte block of data

    Parameters:
    address - the address of where to write
    data - 16 bytes block of data
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    mf_ValueOperation

    public void mf_ValueOperation(int operation,
                                  int src_block,
                                  int dst_block,
                                  long value)
                           throws java.io.IOException,
                                  java.lang.IllegalArgumentException
    Performs increment/decrement/restore operations

    Parameters:
    operation - operation type, one if the MF_OPERATION_INCREMENT, MF_OPERATION_DECREMENT or MF_OPERATION_RESTORE
    src_block - source block number
    dst_block - destination block number
    value - value to be incremented/decremented with
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    mfr_GetSerial

    public long mfr_GetSerial()
                       throws java.io.IOException
    Returns mifare reader serial number

    Returns:
    the serial number
    Throws:
    java.io.IOException

    mf_WriteValue

    public void mf_WriteValue(int address,
                              long value)
                       throws java.io.IOException,
                              java.lang.IllegalArgumentException
    Writes a 4 byte value in the card

    Parameters:
    address - address to write to
    value - the data
    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException

    tbl_IsSupported

    public boolean tbl_IsSupported()
    Checks if the currently connected printer supports tables

    Returns:
    true if tables are supported

    tbl_Create

    public void tbl_Create()
                    throws java.lang.IllegalArgumentException
    Create a new table using default settings - both horizontal and vertical borders around it

    Throws:
    java.lang.IllegalArgumentException

    tbl_Create

    public void tbl_Create(int flags)
                    throws java.lang.IllegalArgumentException
    Create a new table using custom flags

    Parameters:
    flags - one or more of the TABLE_BORDERS_* constants
    Throws:
    java.lang.IllegalArgumentException

    tbl_AddColumn

    public void tbl_AddColumn()
                       throws java.lang.IllegalArgumentException
    Adds a new column using default settings - 12x24 font, plain, vertical border between the cells, left aligning

    Throws:
    java.lang.IllegalArgumentException

    tbl_AddColumn

    public void tbl_AddColumn(int font)
                       throws java.lang.IllegalArgumentException
    Adds a new column using default settings - plain text, vertical border between the cells, left aligning

    Parameters:
    font - one of the FONT_size constants
    Throws:
    java.lang.IllegalArgumentException

    tbl_AddColumn

    public void tbl_AddColumn(int font,
                              int style,
                              int alignment)
                       throws java.lang.IllegalArgumentException
    Adds a new column using custom font and vertical border between the cells

    Parameters:
    font - one of the FONT_size constants
    style - one or more of the font style constants (FONT_BOLD, FONT_ITALIC, etc)
    alignment - text alignment inside the cell, one of the ALIGN_* constants
    Throws:
    java.lang.IllegalArgumentException

    tbl_AddColumn

    public void tbl_AddColumn(int font,
                              int style,
                              int alignment,
                              int flags)
                       throws java.lang.IllegalArgumentException
    Adds a new column

    Parameters:
    font - one of the FONT_size constants
    style - one or more of the font style constants (FONT_BOLD, FONT_ITALIC, etc)
    alignment - text alignment inside the cell, one of the ALIGN_* constants
    flags - one or more of the TABLE_BORDERS_* constants
    Throws:
    java.lang.IllegalArgumentException

    tbl_AddCell

    public void tbl_AddCell(java.lang.String data)
                     throws java.lang.IllegalArgumentException
    Adds a new cell using the font size and style and aligning of the column that cell belongs to

    Parameters:
    data - string data
    Throws:
    java.lang.IllegalArgumentException

    tbl_AddCell

    public void tbl_AddCell(java.lang.String data,
                            int font)
                     throws java.lang.IllegalArgumentException
    Adds a new cell using the font style and aligning of the column that cell belongs to

    Parameters:
    data - string data
    font - font size, one of the FONT_size constants
    Throws:
    java.lang.IllegalArgumentException

    tbl_AddCell

    public void tbl_AddCell(java.lang.String data,
                            int font,
                            int style)
                     throws java.lang.IllegalArgumentException
    Adds a new cell using custom font size and style and aligning of the column that cell belongs to

    Parameters:
    data - string data
    font - font size, one of the FONT_size constants
    style - one or more of the font style constants (FONT_BOLD, FONT_ITALIC, etc)
    Throws:
    java.lang.IllegalArgumentException

    tbl_AddCell

    public void tbl_AddCell(java.lang.String data,
                            int font,
                            int style,
                            int alignment)
                     throws java.lang.IllegalArgumentException
    Adds a new cell using custom font size and style and aligning

    Parameters:
    data - string data
    font - font size, one of the FONT_size constants
    style - one or more of the font style constants (FONT_BOLD, FONT_ITALIC, etc)
    alignment - date aligning, one of the ALIGN_* constants
    Throws:
    java.lang.IllegalArgumentException

    tbl_AddDelimiter

    public void tbl_AddDelimiter()
    Adds aa horizontal black line to the entire row that separates it from the next


    tbl_SetRowHeight

    public void tbl_SetRowHeight(int height)
    Sets the row height that will be used by default for new cells added

    Parameters:
    height - row height, any value less than the characters height will be auto fixed. Default is LINESPACE_DEFAULT

    tbl_Print

    public void tbl_Print()
                   throws java.io.IOException,
                          java.lang.IllegalArgumentException
    Prints current table or throws IllegalArgumentException if cell data cannot be fit into paper

    Throws:
    java.io.IOException
    java.lang.IllegalArgumentException