I'm printing a remarks that are printed on the bluetooth printer, my code works perfectly what's missing and align the lines correctly, from an ENTER, skips a title space.
At the moment when printing shows this ex: titulotestetestetestete
I want you to stay like this ex:
titulo
teste
teste
teste
teste
My code
BluetoothAdapter bth1 = BluetoothAdapter.DefaultAdapter;
ICollection<BluetoothDevice> bthD = bth1.BondedDevices;
foreach (BluetoothDevice d in bthD)
{
if (d.Name.ToString().Trim() == "MPT-III")
{
Java.Util.UUID UUID = Java.Util.UUID.FromString("00001101-0000-1000-8000-00805F9B34FB");
BluetoothSocket s = null;
s = d.CreateRfcommSocketToServiceRecord(UUID);
byte[] buffer = System.Text.Encoding.GetEncoding(0).GetBytes("titulo");
IntPtr createRfcommSocket = JNIEnv.GetMethodID(d.Class.Handle, "createRfcommSocket", "(I)Landroid/bluetooth/BluetoothSocket;");
IntPtr _socket = JNIEnv.CallObjectMethod(d.Handle, createRfcommSocket, new Android.Runtime.JValue(1));
s = Java.Lang.Object.GetObject<BluetoothSocket>(_socket, JniHandleOwnership.TransferLocalRef);
bth1.CancelDiscovery();
//try
//{
s.Connect();
s.OutputStream.Write(buffer, 0, buffer.Length);
s.Close();
//}
//catch
//{
// //Toast.MakeText(this, "Failed to connect: " + connectException.Message, ToastLength.Short).Show();
// Toast.MakeText(this, "Failed to connect", ToastLength.Short).Show();
//}