Error when I print a Barcode in IMZ320 with C# Xamarin Forms

R Rafael Martinez 2 years 9 months ago
5 1 0

I'm using LINK-OS Plugin via Bluetooth with the next code (in IMZ320):

public async Task printBarCode(string code)
        {
            if ((connection != null) && (connection.IsConnected))
            {
                //This is an example of a Code 39 bar code: ^B3
                string zpl = "^XA^FO100,100^BY3^B3N,N,100,Y,N^FD" + code + " ^FS^XZ";

                try
                {
                    connection.Write(Encoding.UTF8.GetBytes(zpl));
                }
                catch (Exception e)
                {
                    await UserDialogs.Instance.AlertAsync("Se dio la siguiente excepción: " + e.Message + ".", "Excepción", "Aceptar");
                }
            }
        }

but when I print this, nothing happens, any suggestion?

Please register or login to post a reply

1 Replies

R Rafael Martinez

My question was solved in another post, my code should be like this to print in my app:

string zpl = "^XA^FO100,100^BY3^B3N,N,100,Y,N^FD" + code + "^FS^XZ\r\n";

CONTACT
Can’t find what you’re looking for?