private void PrintText(string printerLogicalName, Button printButton)
        {
            Jpos.POSPrinter p = new Jpos.POSPrinter(this);
            try
            {
                printButton.Enabled = false;

                p.Open(printerLogicalName); //SPP-R300
                p.Claim(0);
                p.DeviceEnabled = true;

                //Print out text. Be sure to have a new line (\n) at the end of the data.
                p.PrintNormal(
                    Jpos.POSPrinterConst.PtrSReceipt,
                    "This is a test.\nLorem Ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum.\nThis is a new line.\n");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
                Toast.MakeText(this, "Error:\n" + e.StackTrace, ToastLength.Long).Show();
            }
            finally
            {
                printButton.Enabled = true;

                if (p != null)
                {
                    p.Close();
                }
            }
        }
        private void PrintText(string printerLogicalName, Button printButton)
        {
            Jpos.POSPrinter p = new Jpos.POSPrinter(this);
            try
            {
                printButton.Enabled = false;

                p.Open(printerLogicalName); //SPP-R300
                p.Claim(0);
                p.DeviceEnabled = true;

                //Print out text. Be sure to have a new line (\n) at the end of the data.
                p.PrintNormal(
                    Jpos.POSPrinterConst.PtrSReceipt,
                    "This is a test.\nLorem Ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum.\nThis is a new line.\n");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
                Toast.MakeText(this, "Error:\n" + e.StackTrace, ToastLength.Long).Show();
            }
            finally
            {
                printButton.Enabled = true;

                if (p != null)
                    p.Close();
            }
        }