Can anyone help me with this situation? I'm in need of help printing a QR code using Xamarin.Forms (iOS and Android) (I just need the Android version).
Printer Model: Eurosys POSIMPT9BT02 (Generic Printer / Supports ESC POS Print Method) Language: Xamarin.Forms (C#)
I'm sending this via BluetoothSocket in Xamarin.Forms.
I have an Thermal Printer, and I'm already printing text through the BluetoothSocket, and I can print QRCodes, but only small QRCodes, if I print a QRCode with more than >500 characters it will send a QRCode that is not well formatted and the camera can't read it. Here's the code that I have so far.
var byteslist = new List<byte>();
byte[] qrBytes = System.Text.Encoding.ASCII.GetBytes("HERE IS THE TEXT FOR THE QRCODE");
int dataLength = qrBytes.Length + 3;
byte dataPL = (byte)(dataLength % 256);
byte dataPH = (byte)(dataLength / 256);
var bytes = new List<byte>();
bytes.AddRange(new byte[] { 0x1D, 0x28, 0x6b, 0x04, 0x00, 0x31, 0x41, 0x33, 0x00 });
bytes.AddRange(new byte[] { 0x1D, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x43, 0x05 });
bytes.AddRange(new byte[] { 0x1D, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x45, 0x30 });
bytes.AddRange(new byte[] { 0x1D, 0x28, 0x6B, dataPL, dataPH, 0x31, 0x50, 0x30 });
bytes.AddRange(qrBytes);
bytes.AddRange(new byte[] { 0x1D, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x51, 0x30 });
await socket.OutputStream.WriteAsync(bytes.ToArray(), 0, bytes.Count);
socket.Close();
**
String example that im using to print this QRCode: A:503745561B:C:D:FTE:NF:20211027G:21 /H:I1:ESN:0O:0*Q:fH3HRTUk2V7rlYr1xdpc8lfrEVZCxTrR7ylpzKRv0KWtyBAmESRzl33Qq0Etb6RQcuHo9boupsp6 S20gtjLCjVg6sA4qEZfQ9uBaDtB4Au2jyQeFdmm5HAo0GPUSILpRy5fcq0jI2FgNVANnpcV4RbvI BkgFGCEQc6xbx1HhiDw=*R:0008
**
This it my current output, which shows a QRCode that is not working correctly: