Print image using Bluetooth Serial Plugin

can you share your ionic info?

My ionic info

1 Like

thank you…can you share your minimum sdk in config.xml

The minimum sdk is 19.

@test-nikko thank you so much! i already manage to connect it… what i did was i make sure my ionic info is the same as yours.

1 Like

is this the correct way to print image? because the image is not printed as a picture… did i miss something here?

printMyImage() {

		var image = new Image();
    image.crossOrigin='Anonymous';
		image.src = 'assets/imgs/d.jpeg';
		image.onload = function() {

    var canvas = document.createElement('canvas');
    console.log(canvas);
    canvas.width=image.width;
    canvas.height=image.height;
		var context = canvas.getContext('2d');
		context.drawImage(image,0, 0);
		var imageData = canvas.toDataURL('assets/imgs/d.jpeg').replace(/^data:image\/(png|jpg|jpeg);base64,/, ""); //remove mimetype
    console.log(imageData);
		window.DatecsPrinter.printImage(
			imageData, //base64
			canvas.width,
			canvas.height,
			1,
		function(success) {
			alert(JSON.stringify(success));
			// this.printQRcode();
			// this.provideFeed();
			},
		function(error) {
			  alert(JSON.stringify(error));
			}
		)};
}

test-nikko
Thanks a lot & happy new year,

Do you know how to use the cut paper function for the pos printer ?

I have the same error, have you fixed it yet.
please help me !!!

sorry for late reply… i managed to fix this problem by making my ionic info is the same as this one…Print image using Bluetooth Serial Plugin - #22 by test-nikko and dont forget to run the project in actual device.

thanks U. i using the plugin DatecsPrinter and its run very good in android.
But its not run in IOS.How to print image in IOS ???

oh i never try on ios…

oke Thanks U.if U have information of print image in ios .Please contact me !!!

okayy sure… welcomee…

1 Like

hello im getting eror after adding plugin DatecsPrinter and my project on android.
this my eror .gradle\caches\transforms-1\files-1.1\support-compat-28.0.0.aar\2cd26750c9eeb66f6e555fb53f2ba7b9\res\values\values.xml:133:5-70: AAPT: error: resource android:attr/fontVariationSettings not found.
can someone share sample app using this plugin DatecsPrinter in ionic 3 , thanks…

How to print QR code at bluetoothSerial.write(data), please you have any solutions.

Hai, I changed Image to base64 and print this.BluetoothSerial.write(data) it is not printing the image.


It is print the data like this, Please help me.

Hello, try using DatecsPrinter plugin. I have successfully printed image and qr codes using that.

what about printing pdf data?

Did you find a way to print pdf? Please help me out with this. Thanks in advance.

What is c in your code ?
@ak97 this post help you https://stackoverflow.com/questions/46904252/ionic-3-print-image-using-bluetooth-printer