|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.datecs.printers.PrinterSDK
public final class PrinterSDK
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 |
---|
public static final int LOGO_NORMAL
printLogo(int)
public static final int LOGO_DOUBLEWIDTH
printLogo(int)
public static final int LOGO_DOUBLEHEIGHT
printLogo(int)
public static final int LOGO_DWDH
printLogo(int)
public static final int INFO_BATVOLT
getInfo(int)
public static final int INFO_BATPERCENT
getInfo(int)
public static final int INFO_TEMPC
getInfo(int)
public static final int INFO_TEMPFR
getInfo(int)
public static final int INFO_PRINTERVERSION
getInfo(int)
public static final int INFO_PRINTERMODEL
getInfo(int)
public static final int INFO_PAPERWIDTH
getInfo(int)
public static final int INFO_PAGEHEIGHT
getInfo(int)
and page mode commands
public static final int PRINTER_PP50
public static final int PRINTER_PP55
public static final int PRINTER_CMP10
public static final int PRINTER_DPP350
public static final int PRINTER_DPP250
public static final int PRINTER_PP60
public static final int MCU_CARD
public static final int SCERR_NONE
public static final int SCERR_FAILED
public static final int SCERR_FILE_NOT_FOUND
public static final int SCERR_RECORD_NOT_FOUND
public static final int SCERR_INVALID_LENGTH
public static final int SCERR_NO_FILE_SELECTED
public static final int BAR_PRN_UPCA
public static final int BAR_PRN_UPCE
public static final int BAR_PRN_EAN13
public static final int BAR_PRN_EAN8
public static final int BAR_PRN_CODE39
public static final int BAR_PRN_ITF
public static final int BAR_PRN_CODABAR
public static final int BAR_PRN_CODE93
public static final int BAR_PRN_CODE128
public static final int BAR_PRN_PDF417
public static final int BAR_PRN_CODE128AUTO
public static final int BAR_PRN_EAN128AUTO
public static final int BAR_TEXT_NONE
public static final int BAR_TEXT_ABOVE
public static final int BAR_TEXT_BELOW
public static final int BAR_TEXT_BOTH
public static final int BAR_BOOKLAND
public static final int BAR_CODABAR
public static final int BAR_CODE11
public static final int BAR_CODE32
public static final int BAR_CODE128
public static final int BAR_CODE39
public static final int BAR_CODE39_FULLASCII
public static final int BAR_CODE93
public static final int BAR_COMPOSITE
public static final int BAR_COUPON
public static final int BAR_D25
public static final int BAR_DATAMATRIX
public static final int BAR_EAN_128
public static final int BAR_EAN_13
public static final int BAR_EAN_13_PLUS_2
public static final int BAR_EAN_13_PLUS_5
public static final int BAR_EAN_8
public static final int BAR_EAN_8_PLUS_2
public static final int BAR_EAN_8_PLUS_5
public static final int BAR_IATA
public static final int BAR_ISBT_128
public static final int BAR_ISBT_128_CONCATENETED
public static final int BAR_ITF
public static final int BAR_MACROPDF
public static final int BAR_MSI
public static final int BAR_PDF_417
public static final int BAR_BAR_POSTBAR_CANADA
public static final int BAR_POSTNET_US
public static final int BAR_POSTAL_AUSTRALIA
public static final int BAR_POSTAL_JAPAN
public static final int BAR_POSTAL_UK
public static final int BAR_QR_CODE
public static final int BAR_RSS_LIMITED
public static final int BAR_RSS_14
public static final int BAR_RSS_EXPANDED
public static final int BAR_SIGNATURE
public static final int BAR_TRIOPTICCODE39
public static final int BAR_UPCA
public static final int BAR_UPCA_PLUS_2
public static final int BAR_UPCA_PLUS_5
public static final int BAR_UPCE
public static final int BAR_UPCE_PLUS_2
public static final int BAR_UPCE_PLUS_5
public static final int BAR_UPCE1
public static final int BAR_UPCE1_PLUS_2
public static final int BAR_UPCE1_PLUS_5
public static final int MF_STAT_TIMEOUT
public static final int MF_STAT_COLLISION
public static final int MF_STAT_PARITY_ERROR
public static final int MF_STAT_FRAMING_ERROR
public static final int MF_STAT_CRC_ERROR
public static final int MF_STAT_FIFO_OVERFLOW
public static final int MF_STAT_EEPROM_ERROR
public static final int MF_STAT_INVALID_KEY
public static final int MF_STAT_UNKNOWN_ERROR
public static final int MF_STAT_AUTH_ERROR
public static final int MF_STAT_CODE_ERROR
public static final int MF_STAT_BITCOUNT_ERROR
public static final int MF_STAT_NOT_AUTH
public static final int MF_STAT_VALUE_ERROR
public static final int MF_OPERATION_INCREMENT
public static final int MF_OPERATION_DECREMENT
public static final int MF_OPERATION_RESTORE
public static final int INTENSITY70
public static final int INTENSITY80
public static final int INTENSITY90
public static final int INTENSITY100
public static final int INTENSITY120
public static final int INTENSITY150
public static final int FONT_9X16
public static final int FONT_18X16
public static final int FONT_9X32
public static final int FONT_18X32
public static final int FONT_12X24
public static final int FONT_24X24
public static final int FONT_12X48
public static final int FONT_24X48
public static final int FONT_DEFAULT
public static final int FONT_PLAIN
public static final int FONT_BOLD
public static final int FONT_ITALIC
public static final int FONT_UNDERLINE
public static final int FONT_INVERSE
public static final int ALIGN_LEFT
public static final int ALIGN_CENTER
public static final int ALIGN_RIGHT
public static final int TEXT_WORDWRAP
public static final int TEXT_ROTATE_0
public static final int TEXT_ROTATE_90
public static final int TEXT_ROTATE_180
public static final int LINESPACE_DEFAULT
public static final int BLACKMARK_TRESHOLD_DEFAULT
public static final int TABLE_BORDERS_HORIZONTAL
public static final int TABLE_BORDERS_VERTICAL
public static final int TABLE_COLUMN_COMPACT
public static final int PAGE_HORIZONTAL_TOPLEFT
public static final int PAGE_VERTICAL_BOTTOMLEFT
public static final int PAGE_HORIZONTAL_BOTTOMRIGHT
public static final int PAGE_VERTICAL_TOPRIGHT
public static final int COLOR_WHITE
public static final int COLOR_BLACK
public static final int COLOR_INVERSE
Constructor Detail |
---|
public PrinterSDK()
Method Detail |
---|
public void printBitmap(Bitmap bmp)
bmp
- bitmap datapublic void printTextOld(java.lang.String text, int flags) throws java.io.IOException
An example of using tags "{=C}Plain centered text\n{=L}Left centered\n{+B}...bold...{-B}{+I}or ITALIC"
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 neededflags
- used to set function parameters, any combination of the following:
java.io.IOException
public void connect()
public void addPrinterListener(PrinterListener listen_printer)
public void removePrinterListener(PrinterListener listen_printer)
public void close()
flush()
to force data to be sent to the printer
public void flush() throws java.io.IOException
java.io.IOException
public void checkStatus() throws java.io.IOException
java.io.IOException
public void selfTest(boolean longtest) throws java.io.IOException
longtest
- true if you want complete test with fonts and codepage, false for short one
java.io.IOException
public void turnOff() throws java.io.IOException
java.io.IOException
public void lineFeed() throws java.io.IOException
java.io.IOException
public void lineFeed(int lines) throws java.io.IOException, java.lang.IllegalArgumentException
lines
- number of lines to feed at resolution 203DPI
java.io.IOException
java.lang.IllegalArgumentException
public void feedPaper() throws java.io.IOException
java.io.IOException
public void printBarcode(int bartype, java.lang.String barcode) throws java.io.IOException
bartype
- Barcode type, one of the BAR_PRN_* constantsbarcode
- barcode data to be printed
java.io.IOException
public void printBarcode(int bartype, byte[] barcode) throws java.io.IOException, java.lang.IllegalArgumentException
bartype
- Barcode type, one of the BAR_PRN_* constantsbarcode
- barcode data to be printed
java.io.IOException
java.lang.IllegalArgumentException
public void printLogo(int m) throws java.io.IOException, java.lang.IllegalArgumentException
loadLogo(byte[])
function
m
- logo mode, one of the LOGO_* constants
java.io.IOException
java.lang.IllegalArgumentException
public void setAlign(int align) throws java.io.IOException, java.lang.IllegalArgumentException
align
- text align, one of the ALIGN_* constants
java.io.IOException
java.lang.IllegalArgumentException
public void setTextRotation(int rotation) throws java.io.IOException, java.lang.IllegalArgumentException
rotation
- text rotation, one of the TEXT_ROTATE_* constants
java.io.IOException
java.lang.IllegalArgumentException
public void setBarcodeScale(int scale) throws java.lang.IllegalArgumentException
scale
- width of each barcode column. Between 2 and 4, default is 3
java.lang.IllegalArgumentException
public void setBarcodeHeight(int height) throws java.lang.IllegalArgumentException
height
- barcode height in pixels between 1 and 255. Default is 77
java.lang.IllegalArgumentException
public void setBarcodeText(int text) throws java.lang.IllegalArgumentException
text
- barcode hri code position, one of the BAR_TEXT_* constants
java.lang.IllegalArgumentException
public void setIntensity(int intensity) throws java.io.IOException, java.lang.IllegalArgumentException
intensity
- intensity level, one of the INTENSITY* constants
java.io.IOException
java.lang.IllegalArgumentException
public void setFont(int size, int style) throws java.io.IOException, java.lang.IllegalArgumentException
size
- font size, one of the FONT_HxV constantsstyle
- font style, a bitwise OR of any of the FONT_* constants
java.io.IOException
java.lang.IllegalArgumentException
public void setLineSpace(int lineSpace) throws java.io.IOException, java.lang.IllegalArgumentException
lineSpace
- linespace in pixels, or 0 for automatic calculation. Default is 0
java.io.IOException
java.lang.IllegalArgumentException
public void setLeftMargin(int margin) throws java.io.IOException, java.lang.IllegalArgumentException
margin
- left margin in pixels. Default is 0
java.io.IOException
java.lang.IllegalArgumentException
public void printText(java.lang.String text) throws java.io.IOException
An example of using tags "{=C}Plain centered text\n{=L}Left centered\n{+B}...bold...{-B}{+I}or ITALIC"
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
java.io.IOException
public int getInfo(int infocmd) throws java.io.IOException, java.lang.IllegalArgumentException
infocmd
- information type requested, one of the INFO_* constants
java.io.IOException
java.lang.IllegalArgumentException
public java.lang.String getPrinterSerialNumber() throws java.io.IOException, java.lang.UnsupportedOperationException
java.io.IOException
java.lang.UnsupportedOperationException
public void loadCustomFont(byte[] data, boolean activate) throws java.io.IOException, java.lang.IllegalArgumentException
data
- font data created by FontManager. Pass null if you want to just activate/deactivate the custom fontactivate
- true if you want to print using the custom font, false to use the built-in
java.io.IOException
java.lang.IllegalArgumentException
public int getBlackMarkTreshold() throws java.io.IOException, java.lang.UnsupportedOperationException
treshold
- value between 0x20 and 0xc0, default is 0x68
java.io.IOException
java.lang.UnsupportedOperationException
public void setBlackMarkTreshold(int treshold) throws java.io.IOException, java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
treshold
- value between 0x20 and 0xc0, default is 0x68
java.io.IOException
java.lang.UnsupportedOperationException
java.lang.IllegalArgumentException
public int calibrateBlackMark() throws java.io.IOException, java.lang.UnsupportedOperationException
java.io.IOException
java.lang.UnsupportedOperationException
public boolean page_IsSupported()
public void page_Start() throws java.io.IOException, java.lang.UnsupportedOperationException
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.
java.io.IOException
java.lang.UnsupportedOperationException
public void page_Print() throws java.io.IOException, java.lang.UnsupportedOperationException
lineFeed(int lines)
function
java.io.IOException
java.lang.UnsupportedOperationException
public void page_End() throws java.io.IOException, java.lang.UnsupportedOperationException
java.io.IOException
java.lang.UnsupportedOperationException
public void page_SetWorkingArea(int left, int top, int width, int height) throws java.io.IOException, java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
left,
- top, width, height working area rectangle in absolute pixels (i.e. does not depend on the page orientation)
java.io.IOException
java.lang.UnsupportedOperationException
java.lang.IllegalArgumentException
public void page_SetWorkingArea(int left, int top, int width, int height, int orientation) throws java.io.IOException, java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
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
java.io.IOException
java.lang.UnsupportedOperationException
java.lang.IllegalArgumentException
public void page_FillRectangle(int color) throws java.io.IOException, java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
color
- one of the COLOR_* constants
java.io.IOException
java.lang.UnsupportedOperationException
java.lang.IllegalArgumentException
public void page_FillRectangle(int left, int top, int width, int height, int color) throws java.io.IOException, java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
left,
- top, width, height rectangle coordinatescolor
- one of the COLOR_* constants
java.io.IOException
java.lang.UnsupportedOperationException
java.lang.IllegalArgumentException
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
left,
- top, width, height rectangle coordinatesframewidth
- width of the frame (1-64)color
- one of the COLOR_* constants
java.io.IOException
java.lang.UnsupportedOperationException
java.lang.IllegalArgumentException
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
java.io.IOException
java.lang.UnsupportedOperationException
java.lang.IllegalArgumentException
public java.lang.String barcodeType2Text(int type)
type
- barcode type returned from scanBarcode()
public byte[] scanBarcode() throws java.io.IOException, java.lang.UnsupportedOperationException
java.io.IOException
java.lang.UnsupportedOperationException
public java.lang.String[] readCardTracks(int timeout_sec) throws java.io.IOException, java.lang.UnsupportedOperationException
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
java.io.IOException
java.lang.UnsupportedOperationException
public MagneticCardData extractCardData(java.lang.String[] tracks)
tracks
- the string array as returned from readCardTracks(int)
public void loadLogo(byte[] data) throws java.io.IOException, java.lang.IllegalArgumentException
data
- logo bitmap data
java.io.IOException
java.lang.IllegalArgumentException
public void printBitmap(int[] argb, int width, int height) throws java.io.IOException, java.lang.IllegalArgumentException
bmp
- Bitmap object
java.io.IOException
java.lang.IllegalArgumentException
public void sc_Init() throws java.io.IOException
java.io.IOException
public void sc_Close() throws java.io.IOException
java.io.IOException
public byte[] sc_Reset() throws java.io.IOException
java.io.IOException
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
#sc_Power
and sc_Reset()
commands on it
CLA
- The CLA parameter byteINS
- The INS parameter byteP1
- The P1 parameter byteP2
- The P2 parameter bytedata
- The data buffer you want to send with the command, optional, can be nulloffset
- Offset inside the data bufferlength
- Lenght of the datamaxlen
- Defines the maximum number of bytes you want to receive from the smartcard. Defaults to 0
java.io.IOException
java.lang.IllegalArgumentException
public int mf_GetStatus()
public void mf_Init() throws java.io.IOException
java.io.IOException
public void mf_Close() throws java.io.IOException
java.io.IOException
public byte[][] mf_RequestCards() throws java.io.IOException
java.io.IOException
public void mf_SelectCard(byte[] serial) throws java.io.IOException, java.lang.IllegalArgumentException
serial
- one of the serial numbers returned by mf_RequestCards()
java.io.IOException
java.lang.IllegalArgumentException
public void mf_AuthByKey(char type, int block, byte[] key) throws java.io.IOException, java.lang.IllegalArgumentException
type
- key type, either 'A' or 'B'block
- block numberkey
- 6 bytes key
java.io.IOException
java.lang.IllegalArgumentException
public byte[] mf_Read(int address) throws java.io.IOException, java.lang.IllegalArgumentException
address
- the address of what to read
java.io.IOException
java.lang.IllegalArgumentException
public void mf_Write(int address, byte[] data) throws java.io.IOException, java.lang.IllegalArgumentException
address
- the address of where to writedata
- 16 bytes block of data
java.io.IOException
java.lang.IllegalArgumentException
public void mf_ValueOperation(int operation, int src_block, int dst_block, long value) throws java.io.IOException, java.lang.IllegalArgumentException
operation
- operation type, one if the MF_OPERATION_INCREMENT
, MF_OPERATION_DECREMENT
or MF_OPERATION_RESTORE
src_block
- source block numberdst_block
- destination block numbervalue
- value to be incremented/decremented with
java.io.IOException
java.lang.IllegalArgumentException
public long mfr_GetSerial() throws java.io.IOException
java.io.IOException
public void mf_WriteValue(int address, long value) throws java.io.IOException, java.lang.IllegalArgumentException
address
- address to write tovalue
- the data
java.io.IOException
java.lang.IllegalArgumentException
public boolean tbl_IsSupported()
public void tbl_Create() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void tbl_Create(int flags) throws java.lang.IllegalArgumentException
flags
- one or more of the TABLE_BORDERS_* constants
java.lang.IllegalArgumentException
public void tbl_AddColumn() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void tbl_AddColumn(int font) throws java.lang.IllegalArgumentException
font
- one of the FONT_size constants
java.lang.IllegalArgumentException
public void tbl_AddColumn(int font, int style, int alignment) throws java.lang.IllegalArgumentException
font
- one of the FONT_size constantsstyle
- one or more of the font style constants (FONT_BOLD, FONT_ITALIC, etc)alignment
- text alignment inside the cell, one of the ALIGN_* constants
java.lang.IllegalArgumentException
public void tbl_AddColumn(int font, int style, int alignment, int flags) throws java.lang.IllegalArgumentException
font
- one of the FONT_size constantsstyle
- one or more of the font style constants (FONT_BOLD, FONT_ITALIC, etc)alignment
- text alignment inside the cell, one of the ALIGN_* constantsflags
- one or more of the TABLE_BORDERS_* constants
java.lang.IllegalArgumentException
public void tbl_AddCell(java.lang.String data) throws java.lang.IllegalArgumentException
data
- string data
java.lang.IllegalArgumentException
public void tbl_AddCell(java.lang.String data, int font) throws java.lang.IllegalArgumentException
data
- string datafont
- font size, one of the FONT_size constants
java.lang.IllegalArgumentException
public void tbl_AddCell(java.lang.String data, int font, int style) throws java.lang.IllegalArgumentException
data
- string datafont
- font size, one of the FONT_size constantsstyle
- one or more of the font style constants (FONT_BOLD, FONT_ITALIC, etc)
java.lang.IllegalArgumentException
public void tbl_AddCell(java.lang.String data, int font, int style, int alignment) throws java.lang.IllegalArgumentException
data
- string datafont
- font size, one of the FONT_size constantsstyle
- one or more of the font style constants (FONT_BOLD, FONT_ITALIC, etc)alignment
- date aligning, one of the ALIGN_* constants
java.lang.IllegalArgumentException
public void tbl_AddDelimiter()
public void tbl_SetRowHeight(int height)
height
- row height, any value less than the characters height will be auto fixed. Default is LINESPACE_DEFAULTpublic void tbl_Print() throws java.io.IOException, java.lang.IllegalArgumentException
java.io.IOException
java.lang.IllegalArgumentException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |