npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

cordova-plugin-wis-gprinter

v0.0.3

Published

A Cordova Plugin of Gprinter Bluetooth from WIS

Downloads

12

Readme

Functions

initialize(params, success, error) ⇒

初始化蓝牙

Kind: global function

| Param | Type | Description | | --- | --- | --- | | params | * | {request: true} | | success | * | | | error | * | |

connectDevice(address, success, error) ⇒

连接打印机

Kind: global function

| Param | Type | | --- | --- | | address | * | | success | * | | error | * |

isOpenStatus(}, error) ⇒

判断蓝牙打印机是否连接

Kind: global function

| Param | Type | Description | | --- | --- | --- | | } | * | success (open/close) | | error | * | |

getPairedDevices(success, error) ⇒

获取已配对的蓝牙设备

Kind: global function

| Param | Type | | --- | --- | | success | * | | error | * |

closeConnect(success, error) ⇒

关闭连接

Kind: global function

| Param | Type | | --- | --- | | success | * | | error | * |

printTest(success, error) ⇒

打印测试

Kind: global function

| Param | Type | | --- | --- | | success | * | | error | * |

print(success, error, index) ⇒

打印,执行打印指令集,打印最后一步

Kind: global function

| Param | Type | Description | | --- | --- | --- | | success | * | | | error | * | | | index | * | 打印次数 |

printWithCount(success, error) ⇒

打印,执行打印指令集,打印最后一步

Kind: global function

| Param | Type | | --- | --- | | success | * | | error | * |

createTsc(index) ⇒

创建标签打印指令(打印标签的第一步)

Kind: global function

| Param | Type | | --- | --- | | index | * |

addSize(pageWidth, pageHeight) ⇒

该指令用于设定卷标纸的宽度和长度

Kind: global function

| Param | Type | Description | | --- | --- | --- | | pageWidth | * | 标签宽度 单位mm | | pageHeight | * | 标签高度 单位mm |

addGap(printGap) ⇒

该指令用于定义两张卷标纸间的垂直间距距离

Kind: global function

| Param | Type | Description | | --- | --- | --- | | printGap | * | 标签间隙 单位mm |

addBar(x, y, width, height) ⇒

该指令用于在标签上画线

Kind: global function

| Param | Type | Description | | --- | --- | --- | | x | * | 线条左上角X 坐标,单位dots | | y | * | 线条左上角Y 坐标,单位dots | | width | * | 线宽,单位dots | | height | * | 线高,单位dots |

addBox(x_start, y_start, x_end, y_end, thickness) ⇒

该指令用于在卷标上绘制矩形方框

Kind: global function

| Param | Type | Description | | --- | --- | --- | | x_start | * | 方框左上角X 坐标,单位dots | | y_start | * | 方框左上角Y 坐标,单位dots | | x_end | * | 方框右下角X 坐标,单位dots | | y_end | * | 方框右下角Y 坐标,单位dots | | thickness | * | 方框线宽,单位dots |

addBarCode(x, y, codetype, height, readable, rotation, content) ⇒

该指令用来画一维条码 CODE128("128"),CODE128M("128M"),EAN128("EAN128"),ITF25("25"),ITF25C("25C"), CODE39("39"),CODE39C("39C"),CODE39S("39S"), CODE93("93"),EAN13("EAN13"),EAN13_2("EAN13+2"),EAN13_5("EAN13+5"),EAN8("EAN8"), EAN8_2("EAN8+2"),EAN8_5("EAN8+5"),CODABAR("CODA"),POST("POST"),UPCA("UPCA"), UPCA_2("UPCA+2"),UPCA_5("UPCA+5"),UPCE("UPCE13"),UPCE_2("UPCE13+2"),UPCE_5("UPCE13+5"), CPOST("CPOST"),MSI("MSI"), MSIC("MSIC"),PLESSEY("PLESSEY"),ITF14("ITF14"),EAN14("EAN14")

Kind: global function

| Param | Type | Description | | --- | --- | --- | | x | * | 左上角水平坐标起点,以点(dot)表示 | | y | * | 左上角垂直坐标起点,以点(dot)表示 | | codetype | * | 条码类型 | | height | * | 条形码高度,以点(dot)表示 | | readable | * | 0 表示人眼不可识,1 表示人眼可识 | | rotation | * | 条形码旋转角度,顺时针方向 0,90,180,270 | | content | * | 打印内容 |

addQRCode(x, y, level, width, rotation, content) ⇒

该指令用来打印二维码

Kind: global function

| Param | Type | Description | | --- | --- | --- | | x | * | 二维码水平方向起始点坐标 | | y | * | 二维码垂直方向起始点坐标 | | level | * | ECC level 选择QRCODE 纠错等级 L 7% M 15% Q 25% H 30% | | width | * | cell width 二维码宽度1-10 | | rotation | * | 旋转角度(顺时针方向) 0,90,180,270 | | content | * | 内容 |

addText(x, y, font, rotation, x_, y_, str) ⇒

该指令用于打印字符串

Kind: global function

| Param | Type | Description | | --- | --- | --- | | x | * | 文字X 方向起始点坐标 | | y | * | 文字Y 方向起始点坐标 | | font | * | 字体名称 1 8×12 dot 英数字体 2 12×20 dot 英数字体 3 16×24 dot 英数字体 4 24×32 dot 英数字体 5 32×48 dot 英数字体 6 14×19 dot 英数字体OCR-B 7 21×27 dot 英数字体OCR-B 8 14×25 dot 英数字体OCR-A 9 9×17 dot 英数字体 10 12×24 dot 英数字体 TSS16.BF2 简体中文16×16(GB 码) TSS20.BF2 简体中文20×20(GB 码) TST24.BF2 繁体中文24×24(大五码) TSS24.BF2 简体中文24×24(GB 码) K 韩文24×24Font(KS 码) TSS32.BF2 简体中文32×32(GB 码) | | rotation | * | 文字旋转角度(顺时针方向) 0, 90, 180, 270 | | x_ | * | | | y_ | * | | | str | * | 内容 |

addOffset(offset) ⇒

该指令用于控制在剥离模式时(peel-off mode)每张卷标停止的位置,在打印 下一张时打印机会将原先多推出或少推出的部分以回拉方式补偿回来。该指令仅 适用于剥离模式。

Kind: global function

| Param | Type | Description | | --- | --- | --- | | offset | * | 纸张停止的距离 单位mm |

addSpeed(printSpeed) ⇒

该指令用于控制打印速度

Kind: global function

| Param | Type | Description | | --- | --- | --- | | printSpeed | * | 1<=printSpeed<=4 实际支持速度以自检页为准 |

addDensity(printDensity) ⇒

该指令用于控制打印时的浓度

Kind: global function

| Param | Type | Description | | --- | --- | --- | | printDensity | * | 0<=printDensity<=15 |

addDirection(direction, mirror) ⇒

该指令用于定义打印时出纸和打印字体的方向

Kind: global function

| Param | Type | Description | | --- | --- | --- | | direction | * | 0(横向)和1(纵向) | | mirror | * | 0(正常)和1(镜像) |

addReference(x, y) ⇒

该指令用于定义卷标的参考坐标原点。坐标原点位置和打印方向有关 打印机分辨率200 DPI: 1 mm = 8 dots 打印机分辨率300 DPI: 1 mm = 12 dots

Kind: global function

| Param | Type | Description | | --- | --- | --- | | x | * | 水平方向的坐标位置,单位dots | | y | * | 垂直方向的坐标位置,单位dots |

addShift(n) ⇒

该指令表示标签打印偏移量多少设置 打印机分辨率200 DPI: 1 mm = 8 dots 打印机分辨率300 DPI: 1 mm = 12 dots

Kind: global function

| Param | Type | Description | | --- | --- | --- | | n | * | 偏移量 ,单位dot 1mm=8 dots |

addCodepage(codepage) ⇒

该指令用于选择对应的国际字符集 8-bit codepage 字符集代表 437:United States 850:Multilingual 852:Slavic 860:Portuguese 863:Canadian/French 865:Nordic

Windows code page 1250:Central Europe 1252:Latin I 1253:Greek 1254:Turkish

Kind: global function

| Param | Type | | --- | --- | | codepage | * |

addCls() ⇒

该指令用于清除图像缓冲区(image buffer)的数据

Kind: global function

addFeed(feed) ⇒

该指令用于将标签纸向前推送指定的长度 打印机分辨率200 DPI:1 mm = 8 dots 打印机分辨率300 DPI:1 mm = 12 dots

Kind: global function

| Param | Type | Description | | --- | --- | --- | | feed | * | 点数dots |

addBackFeed(backup) ⇒

该指令用于将标签纸向后回拉指定的长度

Kind: global function

| Param | Type | Description | | --- | --- | --- | | backup | * | 点数dots |

addFromfeed() ⇒

该指令用于控制打印机进一张标签纸

Kind: global function

addHome() ⇒

在使用含有间隙或黑标的标签纸时,若不能确定第一张标签纸是否在正确打印位 置时,此指令可将标签纸向前推送至下一张标签纸的起点开始打印。标签尺寸和 间隙需要在本条指令前设置 注:使用该指令时,纸张高度大于或等于30 mm

Kind: global function

addPagePrint() ⇒

该指令用于打印出存储于影像缓冲区内的数据

Kind: global function
Returns: {}

addPrint(page, n) ⇒

该指令用于打印出存储于影像缓冲区内的数据

Kind: global function

| Param | Type | Description | | --- | --- | --- | | page | * | 打印份数 | | n | * | |

addSound(level, interval) ⇒

该指令用于控制蜂鸣器的频率,可设定10 阶的声音,每阶声音的长短由第二个参数控制

Kind: global function

| Param | Type | Description | | --- | --- | --- | | level | * | 音阶:0-9 | | interval | * | 间隔时间:1-4095 |

addLimitfeed(limit) ⇒

该指令用于设定打印机进纸时,若经过所设定的长度仍无法侦测到垂直间距,则打印机在连续纸模式工作

Kind: global function

| Param | Type | Description | | --- | --- | --- | | limit | * | 检测垂直间距 点数dots |

addSelfTest() ⇒

打印自检页

Kind: global function

addErase(x_start, y_start, x_width, y_height) ⇒

该指令用于清除影像缓冲区部分区域的数据

Kind: global function

| Param | Type | Description | | --- | --- | --- | | x_start | * | 反相区域左上角X 坐标,单位dot | | y_start | * | 反相区域左上角Y 坐标,单位dot | | x_width | * | 反相区域宽度,单位dot | | y_height | * | 反相区域高度,单位dot |

addReverse(x_start, y_start, x_width, y_height) ⇒

将指定的区域反相打印

Kind: global function

| Param | Type | Description | | --- | --- | --- | | x_start | * | 反相区域左上角X 坐标,单位dot | | y_start | * | 反相区域左上角Y 坐标,单位dot | | x_width | * | 反相区域宽度,单位dot | | y_height | * | 反相区域高度,单位dot |

addPeel(n) ⇒

该指令用来启动/关闭剥离模式,默认值为关闭

Kind: global function

| Param | Type | Description | | --- | --- | --- | | n | * | 1 起动剥离模式 0 关闭剥离模式 |

addTear(n) ⇒

此命令是用来启用/禁用撕纸位置走到撕纸处,此设置关掉电源后将保存在打印机内

Kind: global function

| Param | Type | Description | | --- | --- | --- | | n | * | 1 启用撕纸位置走到撕纸处 0 禁用撕纸位置走到撕纸处,命令在起始位置有效 |

addReprint(n) ⇒

此命令将禁用/启用标签机在无纸或开盖错误发生后,上纸或合盖后重新打印一次标签内容

Kind: global function

| Param | Type | Description | | --- | --- | --- | | n | * | 1 启用此功能 0 禁止此功能 |

addCut(n) ⇒

此命令用于设置切刀状态,关闭打印机电源后,该设置将会被存储在打印机内存中

Kind: global function

| Param | Type | Description | | --- | --- | --- | | n | * | 1 启用此功能 0 禁止此功能 |

addCutterPieces(pieces) ⇒

在PRINT 命令结束后切纸

Kind: global function

| Param | Type | Description | | --- | --- | --- | | pieces | * | pieces 0-65535,用于设置每几个标签进行切纸 |

addCut(n) ⇒

开启带Response的打印,用于连续打印

Kind: global function

| Param | Type | Description | | --- | --- | --- | | n | * | ON, OFF, BATCH |