Hi folks, I am trying to print a signature image using ionic. I already tried the ionic native bluetooth-serial to print the image but no luck, also I already tried to convert it to binary and send them to the printer.
@test-nikko any update on this?
I am able to print image using the plugin DatecsPrinter. You can see our discussion here.
hello test-nikko, Can i know how you are writing image to printer. Can you display a line of code if possible? Thanks in advance!
I have this function for printing image. Hope this would help.
public printImage(printerAddress, base64Img) {
return new Promise((resolve, reject) => {
window.DatecsPrinter.connect(printerAddress, () => {
window.DatecsPrinter.printImage(base64Img.replace(/^data:image\/(png|jpg|jpeg|gif);base64,/, ""),
200, 200, 1, () => {
resolve(true);
},
(err) => { resolve(false); })
},
(err) => reject(null));
});
}
PS. Sorry for the late reply
Hello, Thanks for the reply. I tried this way but my printer is not decoding the base64, instead it is printing the base64 text[Not printing the image]. I am not able to identify why? Maybe because the printer emulate only zpl and cpcl. So do you have any idea how can i overcome this issue? Any suggestion will be most helpful. Thankyou.