Exemplo n.º 1
0
        public static void PrintTicket()
        {
            byte[] bytesValue = { };
            bytesValue = PrintExtensions.AddBytes(bytesValue, changePrinterEmulationToEscPos);
            bytesValue = PrintExtensions.AddBytes(bytesValue, initializePrinter);

            // set notch distance
            bytesValue = PrintExtensions.AddBytes(bytesValue, new byte[] { 0x1D, 0xE7, 0x00, 0x00 });
            bytesValue = PrintExtensions.AddBytes(bytesValue, new byte[] { 0x1D, 0xF6 });

            //// rotation
            //bytesValue = PrintExtensions.AddBytes(bytesValue, ESC);
            //bytesValue = PrintExtensions.AddBytes(bytesValue, new byte[] { Convert.ToByte('V'), 0x49 });

            bytesValue = PrintExtensions.AddBytes(bytesValue, "Hello World!");
            bytesValue = PrintExtensions.AddBytes(bytesValue, new byte[] { 0x0A });

            // line feed
            bytesValue = PrintExtensions.AddBytes(bytesValue, "Hello There 11");
            bytesValue = PrintExtensions.AddBytes(bytesValue, new byte[] { 0x0A });
            bytesValue = PrintExtensions.AddBytes(bytesValue, new byte[] { 0x1B, 0x64, 0x10 });
            bytesValue = PrintExtensions.AddBytes(bytesValue, "Hello There 12");
            bytesValue = PrintExtensions.AddBytes(bytesValue, new byte[] { 0x0A });

            // set notch distance
            bytesValue = PrintExtensions.AddBytes(bytesValue, new byte[] { 0x1D, 0xE7, 0x01, 0x30 });
            bytesValue = PrintExtensions.AddBytes(bytesValue, StimaPrinterController.getCutPage());

            StimaPrinterController.print(bytesValue);
        }
Exemplo n.º 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //PrinterController.PrintQRCode("Hello");

            StimaPrinterController.PrintTicket();

            //this.sveltaController.PrintData();
        }