类 EscForDotPrinter


  • public class EscForDotPrinter
    extends Esc
    76针式打印机指令 大部分指令使用沿用ESC指令 只有标准模式,无页模式 无打印条码和二维码指令 无打印图片指令
    • 构造器详细资料

      • EscForDotPrinter

        public EscForDotPrinter()
    • 方法详细资料

      • 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 在类中 Esc
        参数:
        bitmap - 图片
        dither - 是否抖动
      • addBitmap

        @Deprecated
        public void addBitmap​(@Nullable
                              android.graphics.Bitmap bitmap,
                              boolean dither,
                              int bitmapMode)
        已过时。
        添加图片,GP-76系列不能添加光栅位图, 位图数据只支持8位
        覆盖:
        addBitmap 在类中 Esc
      • 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 - 条码内容,内容需符合条码类型的内容类型 若存在非法字符,将不打印条码 若内容长度超过条码有效长度,打印结果不可知
      • 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 - 高度
      • 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或1
        lowPulseTime - 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