Open simo154 opened 5 years ago
var image = new Image(); image.src = 'assets/imgs/d.jpeg'; image.onload = function() { var canvas = document.createElement('canvas'); canvas.height = 100; canvas.width = 100; var context = canvas.getContext('2d'); context.drawImage(image, 0, 0); var imageData = canvas.toDataURL('image/jpeg').replace(/^data:image\/(png|jpg|jpeg);base64,/, ""); console.log(imageData); window.DatecsPrinter.printImage( imageData, canvas.width, canvas.height, 1, function() { alert('success!'); }, function() { alert('error!'); } )
};
why it was printed "pdf417 input error" instead of the image?
};
why it was printed "pdf417 input error" instead of the image?