Closed coolara closed 3 years ago
this.printQRCode(300,'http://www.baidu.com') printQRCode(width, url) { return new Promise((resolve) => { const QRCode = require('yaqrcode'); const imageBase64 = QRCode(url, {size: 200, errorCorrectionLevel: 'H'}); const imageData = imageBase64.replace(/^data:image\/(png|jpg|jpeg|gif);base64,/, ''); window.DatecsPrinter.printImage( imageData, width, width, 1, () => { resolve(); }, (error) => { alert(JSON.stringify(error)); } ); }); }
my error code. it's perfect plugin