'MTP-3 bluetooth thermal printer print qr code
Im trying to make an android application in xamarin that can print qr code, im using MTP-3 GOOJPRINT thermal printer. I got the printer plain text already , now im trying to print barcode/qr code.
using Com.Lvrenyang.IO;
using Java.Util;
[assembly: Xamarin.Forms.Dependency(typeof(AndroidBluetoothService))]
namespace QRPrint.Droid.Common
{
public void Print(string deviceName )
{
Pos pos = new Pos();
Label1 lb1 = new Label1();
BTPrinting btprint = new BTPrinting();
byte[] outputQRVal = Encoding.UTF8.GetBytes("41v41as-51fsd-315");
lb1.DrawBarcode(0, 0, 0, 0 ,0, 0, outputQRVal); // ????
BluetoothDevice device = (from bd in bluetoothAdapter?.BondedDevices where bd?.Name == deviceName select bd).FirstOrDefault();
btprint.Open(device.Address);
btprint.Write(outputQRVal, 0, outputQRVal.Length);
btprint.Close();
}
}
Here is the library and printer of the Thermal Printer: http://xmjprt.com/2457746-2457746.html
Anyone know how to print out the barcode/qr?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|