类 EscForDotPrinter
- java.lang.Object
-
- com.gainscha.sdk2.command.Esc
-
- com.gainscha.sdk2.command.EscForDotPrinter
-
public class EscForDotPrinter extends Esc
76针式打印机指令 大部分指令使用沿用ESC指令 只有标准模式,无页模式 无打印条码和二维码指令 无打印图片指令
-
-
嵌套类概要
-
从类继承的嵌套类/接口 com.gainscha.sdk2.command.Esc
Esc.Align, Esc.BarcodeHumanReadTextLocation, Esc.BarcodeType, Esc.BitmapMode, Esc.CharacterSet, Esc.CodePage, Esc.CutMode, Esc.PrintBehavior, Esc.QrcodeErrorLevel, Esc.TextColor, Esc.TextFont, Esc.TextUnderLine
-
-
字段概要
-
从类继承的字段 com.gainscha.sdk2.command.Esc
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, BARCODE_CODABAR, BARCODE_CODE128, BARCODE_CODE39, BARCODE_CODE93, BARCODE_EAN13, BARCODE_EAN8, BARCODE_HUMAN_READ_TEXT_ABOVE, BARCODE_HUMAN_READ_TEXT_ABOVE_BOTTOM, BARCODE_HUMAN_READ_TEXT_BOTTOM, BARCODE_HUMAN_READ_TEXT_NONE, BARCODE_ITF, BARCODE_UPC_A, BARCODE_UPC_E, BITMAP_MODE_24_BITS, BITMAP_MODE_24_BITS_DUAL, BITMAP_MODE_8_BITS, BITMAP_MODE_8_BITS_DUAL, buffer, CODE_PAGE_1251, CODE_PAGE_ARABIC, CODE_PAGE_CANADIAN, CODE_PAGE_CYRILLIC2, CODE_PAGE_EAST_EUROPE, CODE_PAGE_GREEK, CODE_PAGE_HEBREW1, CODE_PAGE_HEBREW2, CODE_PAGE_IRAN, CODE_PAGE_IRAN2, CODE_PAGE_ISRAEL, CODE_PAGE_KATAKANA, CODE_PAGE_LATIN2, CODE_PAGE_LATVIAN, CODE_PAGE_MULTI_LINGUA1, CODE_PAGE_NORDIC, CODE_PAGE_PC1001, CODE_PAGE_PC747, CODE_PAGE_PC858, CODE_PAGE_PC864, CODE_PAGE_PORTUGUESE, CODE_PAGE_STD_EUROPE, CODE_PAGE_THAI, CODE_PAGE_UYGUR, CODE_PAGE_VIETNAM, CODE_PAGE_WEST_EUROPE, CODE_PAGE_WPC1252, CODE_PAGE_WPC1257, CODE_PAGE_WPC1257_N, CUT_MODE_FULL, CUT_MODE_HALF, CUT_MODE_HALF_OFFSET, PRINT_BEHAVIOR_BEEP, PRINT_BEHAVIOR_BEEP_LED_LIGHT, PRINT_BEHAVIOR_LED_LIGHT, PRINT_BEHAVIOR_NONE, QRCODE_ERROR_LEVEL_H, QRCODE_ERROR_LEVEL_L, QRCODE_ERROR_LEVEL_M, QRCODE_ERROR_LEVEL_Q, TEXT_BOLD, TEXT_CHARACTERS_CHINA, TEXT_CHARACTERS_CROATIA, TEXT_CHARACTERS_DENMARK1, TEXT_CHARACTERS_DENMARK2, TEXT_CHARACTERS_FRANCE, TEXT_CHARACTERS_GERMANY, TEXT_CHARACTERS_ITALY, TEXT_CHARACTERS_JAPAN, TEXT_CHARACTERS_KOREAN, TEXT_CHARACTERS_LATIN_AMERICA, TEXT_CHARACTERS_NORWAY, TEXT_CHARACTERS_SPAIN1, TEXT_CHARACTERS_SPAIN2, TEXT_CHARACTERS_SWEDEN, TEXT_CHARACTERS_UK, TEXT_CHARACTERS_USA, TEXT_COLOR_BLACK, TEXT_COLOR_WHITE, TEXT_FONT_16_PX, TEXT_FONT_24_PX, TEXT_STRICKOUT, TEXT_TWICE_HEIGHT, TEXT_TWICE_WIDTH, TEXT_UNDERLINE, TEXT_UNDERLINE_1_PX, TEXT_UNDERLINE_2_PX, TEXT_UNDERLINE_NONE
-
-
构造器概要
构造器 构造器 说明 EscForDotPrinter()
-
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 void
addBarcode(int barcodeType, int width, int height, boolean humanReadText, int humanReadTextSize, java.lang.String content)
void
addBarcode(int barcodeType, java.lang.String content)
已过时。void
addBitmap(android.graphics.Bitmap bitmap, boolean dither)
添加图片,GP-76系列不能添加光栅位图, 位图数据只支持8位void
addBitmap(android.graphics.Bitmap bitmap, boolean dither, int bitmapMode)
已过时。void
addBitmapFromFlash(int bitmapIndex, boolean widthMultiply, boolean heightMultiply)
已过时。void
addBitmapFromMemory(boolean widthMultiply, boolean heightMultiply)
已过时。void
addQrcode(int width, int height, java.lang.String content)
void
addQrcode(java.lang.String content)
已过时。void
addQrcodeFromMemory()
已过时。void
getPrinterBrand()
已过时。void
getPrinterModel()
已过时。void
getPrinterStatus()
已过时。void
printAndExitPageMode()
已过时。void
printAndKeepPageMode()
已过时。void
setBarcodeHeight(int height)
已过时。void
setBarcodeHumanReadTextFont(int textFont)
已过时。void
setBarcodeHumanReadTextLocation(int barcodeHumanReadTextLocation)
已过时。void
setBarcodeModuleWidth(int moduleWidth)
已过时。void
setBeepAndLedLightOnPrint(int count, int duration, int printBehavior)
已过时。void
setBitmapToFlash(boolean dither, android.graphics.Bitmap... bitmaps)
已过时。void
setBitmapToMemory(android.graphics.Bitmap bitmap, boolean dither)
已过时。void
setClearPageModeBuffer()
已过时。void
setEnterPageMode()
已过时。void
setMarginLeft(int units)
已过时。void
setMoveCursorRelativeTo(int units)
已过时。void
setMoveCursorTo(int units)
已过时。void
setMoveUnit(int unitX, int unitY)
已过时。void
setOpenCashDrawerRT(int pin, int highPulseTime, int lowPulseTime)
已过时。void
setPageModeSize(int marginLeft, int marginTop, int width, int height)
已过时。void
setPrintableWidth(int units)
已过时。void
setPrintEnable(boolean enable)
已过时。void
setQrcodeErrorLevel(int qrcodeErrorLevel)
已过时。void
setQrcodeModuleSize(int moduleSize)
已过时。void
setQrcodeToMemory(java.lang.String content)
已过时。void
setRestoreOnError(boolean restorePrint)
todo 确认此指令和ESC是否有区别(指令手册写的是有区别的)void
setRotation90(boolean enable)
已过时。void
setTextColor(int textColor)
已过时。void
setTextMultiply(int widthMultiply, int heightMultiply)
已过时。-
从类继承的方法 com.gainscha.sdk2.command.Esc
addText, addTextTab, addUserCommand, getData, getPrinterStatus, getPrinterStatusRT, initPrinter, print, printAndFeedLines, printAndFeedUnits, resetTextLineSpace, setAlign, setCharacterSet, setCodePage, setCustomCharacter, setCutOffsetByBlackMark, setCutterAfterPrint, setDisableCustomCharacter, setEnableCustomCharacterSet, setEnableKeyPress, setHorizontalJumpPositions, setOpenCashDrawer, setPaperSensorState, setPaperSensorState2, setPrinterStatusNotify, setPrintOffsetByBlackMark, setPrintStartToBlackMark, setRotation180, setTextBold, setTextChineseLetterSpace, setTextFont, setTextHeavy, setTextLetterSpace, setTextLineSpace, setTextStyle, setTextUnderLine
-
-
-
-
方法详细资料
-
addBarcode
public void addBarcode(int barcodeType, int width, int height, boolean humanReadText, int humanReadTextSize, java.lang.String content)
-
addQrcode
public void addQrcode(int width, int height, java.lang.String content)
-
addBitmap
public void addBitmap(@Nullable android.graphics.Bitmap bitmap, boolean dither)
添加图片,GP-76系列不能添加光栅位图, 位图数据只支持8位
-
addBitmap
@Deprecated public void addBitmap(@Nullable android.graphics.Bitmap bitmap, boolean dither, int bitmapMode)
已过时。添加图片,GP-76系列不能添加光栅位图, 位图数据只支持8位
-
setRestoreOnError
public void setRestoreOnError(boolean restorePrint)
todo 确认此指令和ESC是否有区别(指令手册写的是有区别的)- 覆盖:
setRestoreOnError
在类中Esc
- 参数:
restorePrint
- 是否从错误中恢复上次中断的打印
-
addBarcode
@Deprecated public void addBarcode(int barcodeType, java.lang.String content)
已过时。从类复制的说明:Esc
添加条码- 覆盖:
addBarcode
在类中Esc
- 参数:
barcodeType
- 条码类型content
- 条码内容,内容需符合条码类型的内容类型 若存在非法字符,将不打印条码 若内容长度超过条码有效长度,打印结果不可知
-
addQrcode
@Deprecated public void addQrcode(java.lang.String content)
已过时。从类复制的说明:Esc
添加二维码Qrcode- 覆盖:
addQrcode
在类中Esc
- 参数:
content
- 条码内容- 另请参阅:
Esc.setQrcodeToMemory(String)
,Esc.addQrcodeFromMemory()
-
addQrcodeFromMemory
@Deprecated public void addQrcodeFromMemory()
已过时。从类复制的说明:Esc
添加二维码Qrcode,从内存符号存储器读取保存的二维码- 覆盖:
addQrcodeFromMemory
在类中Esc
- 另请参阅:
Esc.setQrcodeToMemory(String)
-
setBarcodeHeight
@Deprecated public void setBarcodeHeight(int height)
已过时。从类复制的说明:Esc
设置条码高度- 覆盖:
setBarcodeHeight
在类中Esc
- 参数:
height
- 条码高度0-255
-
setBarcodeHumanReadTextFont
@Deprecated public void setBarcodeHumanReadTextFont(int textFont)
已过时。从类复制的说明:Esc
设置条码可读字符的字体- 覆盖:
setBarcodeHumanReadTextFont
在类中Esc
- 参数:
textFont
- 字体
-
setBarcodeHumanReadTextLocation
@Deprecated public void setBarcodeHumanReadTextLocation(int barcodeHumanReadTextLocation)
已过时。从类复制的说明:Esc
设置条码可读字符的位置- 覆盖:
setBarcodeHumanReadTextLocation
在类中Esc
- 参数:
barcodeHumanReadTextLocation
- 文本位置
-
setBarcodeModuleWidth
@Deprecated public void setBarcodeModuleWidth(int moduleWidth)
已过时。从类复制的说明:Esc
设置条码模块宽度Esc.setBarcodeHeight(int)
单基本模块条码有: UPC-A UPC-E EAN13 EAN8 CODE93 CODE128 双基本模块条码有: CODE39 ITF CODEBAR- 覆盖:
setBarcodeModuleWidth
在类中Esc
- 参数:
moduleWidth
- 模块宽度,取值如下,对应的宽度单位是毫米 |- 取值 -|- 单模块宽度 -|- 双模块窄条 -|- 双模块宽条 -| | 2 | 0.25 | 0.25 | 0.625 | | 3 | 0.375 | 0.375 | 1.0 | | 4 | 0.5 | 0.5 | 1.25 | | 5 | 0.625 | 0.625 | 1.625 | | 6 | 0.75 | 0.75 | 1.875 |
-
setQrcodeToMemory
@Deprecated public void setQrcodeToMemory(java.lang.String content)
已过时。从类复制的说明:Esc
保存二维码到内存的符号存储区 保存二维码后,再使用读取二维码指令执行打印Esc.addQrcodeFromMemory()
- 覆盖:
setQrcodeToMemory
在类中Esc
- 参数:
content
- 内容
-
setQrcodeErrorLevel
@Deprecated public void setQrcodeErrorLevel(int qrcodeErrorLevel)
已过时。从类复制的说明:Esc
设置QRCode纠错级别- 覆盖:
setQrcodeErrorLevel
在类中Esc
- 参数:
qrcodeErrorLevel
- 纠错级别
-
setQrcodeModuleSize
@Deprecated public void setQrcodeModuleSize(int moduleSize)
已过时。从类复制的说明:Esc
设置QRCode单元模块大小- 覆盖:
setQrcodeModuleSize
在类中Esc
- 参数:
moduleSize
- 模块大小(1-15)
-
printAndExitPageMode
@Deprecated public void printAndExitPageMode()
已过时。从类复制的说明:Esc
打印页缓冲区数据并返回标准模式,清理页缓冲区- 覆盖:
printAndExitPageMode
在类中Esc
-
printAndKeepPageMode
@Deprecated public void printAndKeepPageMode()
已过时。从类复制的说明:Esc
打印页缓冲区数据并保持页模式,页缓冲区内容不变- 覆盖:
printAndKeepPageMode
在类中Esc
-
setClearPageModeBuffer
@Deprecated public void setClearPageModeBuffer()
已过时。从类复制的说明:Esc
清理页缓冲区的数据- 覆盖:
setClearPageModeBuffer
在类中Esc
-
setEnterPageMode
@Deprecated public void setEnterPageMode()
已过时。从类复制的说明:Esc
进入页模式- 覆盖:
setEnterPageMode
在类中Esc
-
setPageModeSize
@Deprecated public void setPageModeSize(int marginLeft, int marginTop, int width, int height)
已过时。从类复制的说明:Esc
设置页模式的页大小- 覆盖:
setPageModeSize
在类中Esc
- 参数:
marginLeft
- 左边距marginTop
- 上边距width
- 宽度height
- 高度
-
setBitmapToMemory
@Deprecated public void setBitmapToMemory(@Nullable android.graphics.Bitmap bitmap, boolean dither)
已过时。从类复制的说明:Esc
下载图片到打印机内存 使用方法:Esc.addBitmapFromMemory(boolean, boolean)
下载的位图在以下情况下被清除 1. 初始化打印机Esc.initPrinter()
2. 用户自定义字符Esc.setCustomCharacter(int, int, int, int, byte[])
3. 下载FLASH位图Esc.setBitmapToFlash(boolean, Bitmap...)
- 覆盖:
setBitmapToMemory
在类中Esc
- 参数:
bitmap
- 图片dither
- 是否执行图片抖动,彩色图片建议执行抖动
-
addBitmapFromFlash
@Deprecated public void addBitmapFromFlash(int bitmapIndex, boolean widthMultiply, boolean heightMultiply)
已过时。从类复制的说明:Esc
添加图片,从Flash中添加已下载的图片Esc.setBitmapToFlash(boolean, Bitmap...)
图片不存在时指令无效 标准模式下,只有在打印缓冲区无数据时此指令才有效 打印完后自动换行- 覆盖:
addBitmapFromFlash
在类中Esc
- 参数:
bitmapIndex
- 图号widthMultiply
- 倍宽heightMultiply
- 倍高
-
addBitmapFromMemory
@Deprecated public void addBitmapFromMemory(boolean widthMultiply, boolean heightMultiply)
已过时。从类复制的说明:Esc
添加图片,从内存中添加已下载的图片Esc.setBitmapToMemory(Bitmap, boolean)
图片不存在时指令无效 标准模式下,只有在打印缓冲区无数据时此指令才有效 打印完后自动换行- 覆盖:
addBitmapFromMemory
在类中Esc
- 参数:
widthMultiply
- 倍宽heightMultiply
- 倍高
-
setBitmapToFlash
@Deprecated public void setBitmapToFlash(boolean dither, @Nullable android.graphics.Bitmap... bitmaps)
已过时。从类复制的说明:Esc
下载图片到flash存储器,容量一般为8K 使用方法Esc.addBitmapFromFlash(int, boolean, boolean)
一个位图下载后在flash占用空间: 头信息4字节 + 数据 指令执行过程不打印,不响应查询 数据持久化存储,关机重启数据保留 频繁写入容易损坏flash存储器,建议尽量少写数据到flash,可使用下载图片到内存的方式替换Esc.setBitmapToMemory(Bitmap, boolean)
- 覆盖:
setBitmapToFlash
在类中Esc
bitmaps
- 下载的位图(图片),图片宽高必须是8的倍数
-
getPrinterStatus
@Deprecated public void getPrinterStatus()
已过时。从类复制的说明:Esc
获取打印机状态,网口打印机使用4000端口发送,打印机数据用9100端口打印机将返回4字节状态信息 字节1: 打印机信息 字节2: 错误信息 字节3: 传感器检测结果 字节4: 纸传感器状态
Esc.setPaperSensorState(int)
- 覆盖:
getPrinterStatus
在类中Esc
-
getPrinterModel
@Deprecated public void getPrinterModel()
已过时。从类复制的说明:Esc
获取打印机型号- 覆盖:
getPrinterModel
在类中Esc
-
getPrinterBrand
@Deprecated public void getPrinterBrand()
已过时。从类复制的说明:Esc
获取打印机品牌- 覆盖:
getPrinterBrand
在类中Esc
-
setTextColor
@Deprecated public void setTextColor(int textColor)
已过时。从类复制的说明:Esc
设置字体颜色,只能黑白两种颜色- 覆盖:
setTextColor
在类中Esc
- 参数:
textColor
- 字体颜色, 0白1黑
-
setTextMultiply
@Deprecated public void setTextMultiply(int widthMultiply, int heightMultiply)
已过时。从类复制的说明:Esc
设置字符放大倍数- 覆盖:
setTextMultiply
在类中Esc
- 参数:
widthMultiply
- 宽度放大倍数(1-8)heightMultiply
- 高度放大倍数(1-8)
-
setRotation90
@Deprecated public void setRotation90(boolean enable)
已过时。从类复制的说明:Esc
设置字符顺时针旋转90度 只在标准模式下有效,旋转后下划线不打印- 覆盖:
setRotation90
在类中Esc
- 参数:
enable
- 是否旋转
-
setOpenCashDrawerRT
@Deprecated public void setOpenCashDrawerRT(int pin, int highPulseTime, int lowPulseTime)
已过时。从类复制的说明:Esc
实时打开钱箱- 覆盖:
setOpenCashDrawerRT
在类中Esc
- 参数:
pin
- 引脚号(0或1)highPulseTime
- 0或1lowPulseTime
- 1到8
-
setMoveUnit
@Deprecated public void setMoveUnit(int unitX, int unitY)
已过时。从类复制的说明:Esc
设置横向和纵向移动单位长度- 覆盖:
setMoveUnit
在类中Esc
- 参数:
unitX
- 横向移动单位,实际值为1/unitX英寸unitY
- 纵向移动单位,实际值为1/unitY英寸
-
setMoveCursorTo
@Deprecated public void setMoveCursorTo(int units)
已过时。从类复制的说明:Esc
设置当前光标的绝对位置- 覆盖:
setMoveCursorTo
在类中Esc
- 参数:
units
- 移动单位数,普通模式下使用横向移动单位- 另请参阅:
Esc.setMoveUnit(int, int)
-
setMoveCursorRelativeTo
@Deprecated public void setMoveCursorRelativeTo(int units)
已过时。从类复制的说明:Esc
设置当前光标的相对位置- 覆盖:
setMoveCursorRelativeTo
在类中Esc
- 参数:
units
- 移动单位数,普通模式下使用横向移动单位- 另请参阅:
Esc.setMoveUnit(int, int)
-
setMarginLeft
@Deprecated public void setMarginLeft(int units)
已过时。从类复制的说明:Esc
设置左边距- 覆盖:
setMarginLeft
在类中Esc
- 参数:
units
- 左边距- 另请参阅:
Esc.setMoveUnit(int, int)
-
setPrintableWidth
@Deprecated public void setPrintableWidth(int units)
已过时。从类复制的说明:Esc
设置打印区域宽度- 覆盖:
setPrintableWidth
在类中Esc
- 参数:
units
- 宽度- 另请参阅:
Esc.setMoveUnit(int, int)
-
setPrintEnable
@Deprecated public void setPrintEnable(boolean enable)
已过时。从类复制的说明:Esc
设置允许/禁止打印- 覆盖:
setPrintEnable
在类中Esc
- 参数:
enable
- 是否允许
-
setBeepAndLedLightOnPrint
@Deprecated public void setBeepAndLedLightOnPrint(int count, int duration, int printBehavior)
已过时。从类复制的说明:Esc
设置打印时蜂鸣器鸣叫和报警灯闪烁- 覆盖:
setBeepAndLedLightOnPrint
在类中Esc
-
-