miniprogram-bluetoothprinter
miniprogram-bluetoothprinter copied to clipboard
增加了打印二维码功能
我在楼主开源的项目上,根据自己的需求增加了打印二维码的功能!
在printerjobs.js 加入代码。
printerJobs.prototype.qrcode = function (content = '') { this._enqueue([0x1b, 0x5a, 0x01, 0x03, 0x08, 0x09, 0x00]); this.text(content); return this; };
然后在输出打印内容出追加.qrcode('123456789')方法就可以打印出二维码了。扫出来的结果是:123456789.可支持英文字符,但我的项目需求只做了九个字节的打印。
我的打印机的是### ESP的指令。
我打出来还是文字,这是为什么呢?
@zengholiday 打印出文字123456789,太坑了你!