|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.device.PrinterManager
public class PrinterManager
The android.device.PriterManager provides support for printer
Constructor Summary | |
---|---|
PrinterManager()
|
Method Summary | |
---|---|
int |
prn_clearPage()
Clear the current page. |
void |
prn_close()
Close the printer |
int |
prn_drawBarcode(java.lang.String data,
int x,
int y,
int barcodetype,
int width,
int height,
int rotate)
|
int |
prn_drawBitmap(android.graphics.Bitmap bmp,
int xDest,
int yDest)
Draw a bitmap on the current page |
int |
prn_drawLine(int x0,
int y0,
int x1,
int y1,
int lineWidth)
Draw a line in the current page. |
int |
prn_drawText(java.lang.String data,
int x,
int y,
java.lang.String fontname,
int fontsize,
boolean bold,
boolean italic,
int rotate)
Draw text on the current page |
int |
prn_drawTextEx(java.lang.String data,
int x,
int y,
int width,
int height,
java.lang.String fontname,
int fontsize,
int rotate,
int style,
int format)
|
int |
prn_getStatus()
|
int |
prn_getTemp()
Get current the printer's temperature Note: The printer must be opened prior to calling this method |
int |
prn_open()
Opens the printer |
int |
prn_printPage(int rotate)
Print the current page. |
int |
prn_setBlack(int level)
Set print gray level |
int |
prn_setSpeed(int level)
Set print speed level |
int |
prn_setupPage(int width,
int height)
Set the page size. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrinterManager()
Method Detail |
---|
public int prn_open()
public int prn_getTemp()
public int prn_setSpeed(int level)
level
- value is 50 to 80,default 62
public int prn_setBlack(int level)
level
- value is 0 to 30, default 15.
public void prn_close()
public int prn_setupPage(int width, int height)
width
- Page width, -1 means largest possible width (width = 384)。height
- Page height. -1 means printer driver to manage the page height.
public int prn_clearPage()
public int prn_printPage(int rotate)
rotate
- The rotation angle, currently supports only 0 (non-rotating)
public int prn_drawLine(int x0, int y0, int x1, int y1, int lineWidth)
x0
- start point X axis,y0
- start point Y axisx1
- end point X axis,y1
- end point Y axislineWidth
- in pixel.
public int prn_drawText(java.lang.String data, int x, int y, java.lang.String fontname, int fontsize, boolean bold, boolean italic, int rotate)
data
- The string to be drawx
- Start point X axis,y
- Start point Y axisfontname
- Font to be used, otherwise, default system font is used. Custom fonts can be specified, for example, specifying the full path /mnt/sdcard/xxx.ttf.fontsize
- The font size, in pixelbold
- The font bold styleitalic
- The font italic stylerotate
- The text direction. 0 no rotation, 1 rotate 90 degree, 2 rotate 180 degree, 3 rotate 270 degree.
public int prn_drawTextEx(java.lang.String data, int x, int y, int width, int height, java.lang.String fontname, int fontsize, int rotate, int style, int format)
data
- The string to be drawx
- Start point X axis,y
- Start point Y axiswidth
- Text is printed to the width of the rectangle on the pageheight
- Text is printed to the height of the rectangle on the pagefontname
- font to be use, otherwise, default system font is used. Or custom fonts i.e. /mnt/sdcard/xxx.ttf the path.fontsize
- the font size, in pixelrotate
- print the text degree, 0 no rotation, 1 rotate 90 degree, 2 rotate 180 degree, 3 rotate 270 degree.style
- Font style (0x0001 - underline, 0x0002 - italic, 0x0004 - bold 0x0008 reverse effect, 0x0010 - strike out), you can mix the style by using the or operator, style= 0x0002|0x0004format
- Set to 0 means word wrap. Set to 1 means word wrap at the specified height and width
public int prn_drawBarcode(java.lang.String data, int x, int y, int barcodetype, int width, int height, int rotate)
data
- The barcode textx
- Start point at X axis,y
- Start point at Y axisbarcodetype
- Following Table shows the supported symbology
BARCODE_CODE11 | 1 | |
BARCODE_C25MATRIX | 2 | |
BARCODE_C25INTER | 3 | |
BARCODE_C25IATA | 4 | |
BARCODE_C25LOGIC | 6 | |
BARCODE_C25IND | 7 | |
BARCODE_CODE39 | 8 | |
BARCODE_EXCODE39 | 9 | |
BARCODE_EANX | 13 | |
BARCODE_EAN128 | 16 | |
BARCODE_CODABAR | 18 | |
BARCODE_CODE128 | 20 | |
BARCODE_DPLEIT | 21 | |
BARCODE_DPIDENT | 22 | |
BARCODE_CODE16K | 23 | |
BARCODE_CODE49 | 24 | |
BARCODE_CODE93 | 25 | |
BARCODE_FLAT | 28 | |
BARCODE_RSS14 | 29 | |
BARCODE_RSS_LTD | 30 | |
BARCODE_RSS_EXP | 31 | |
BARCODE_TELEPEN | 32 | |
BARCODE_UPCA | 34 | |
BARCODE_UPCE | 37 | |
BARCODE_POSTNET | 40 | |
BARCODE_MSI_PLESSEY | 47 | |
BARCODE_FIM | 49 | |
BARCODE_LOGMARS | 50 | |
BARCODE_PHARMA | 51 | |
BARCODE_PZN | 52 | |
BARCODE_PHARMA_TWO | 53 | |
BARCODE_PDF417 | 55 | |
BARCODE_PDF417TRUNC | 56 | |
BARCODE_MAXICODE | 57 | |
BARCODE_QRCODE | 58 | |
BARCODE_CODE128B | 60 | |
BARCODE_AUSPOST | 63 | |
BARCODE_AUSREPLY | 66 | |
BARCODE_AUSROUTE | 67 | |
BARCODE_AUSREDIRECT | 68 | |
BARCODE_ISBNX | 69 | |
BARCODE_RM4SCC | 70 | |
BARCODE_DATAMATRIX | 71 | |
BARCODE_EAN14 | 72 | |
BARCODE_CODABLOCKF | 74 | |
BARCODE_NVE18 | 75 | |
BARCODE_JAPANPOST | 76 | |
BARCODE_KOREAPOST | 77 | |
BARCODE_RSS14STACK | 79 | |
BARCODE_RSS14STACK_OMNI | 80 | |
BARCODE_RSS_EXPSTACK | 81 | |
BARCODE_PLANET | 82 | |
BARCODE_MICROPDF417 | 84 | |
BARCODE_ONECODE | 85 | |
BARCODE_PLESSEY | 86 |
width
- There are four thickness level to the lines, 1 being the thinnest and 4 being the thickest.height
- The barcode height in pixelrotate
- The barcode rotation, 0 no rotation, 1 rotate 90 degree, 2 rotate 180 degree, 3 rotate 270 degree.
public int prn_drawBitmap(android.graphics.Bitmap bmp, int xDest, int yDest)
bmp
- The bitmap to be drawnxDest
- Start point at X axis,yDest
- Start point at Y axis,
public int prn_getStatus()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |