Example #1
0
        private void Cut(SerialPrinter.CutType CutType)
        {
            byte[]        c_bytes = { 0x1B, 0x63,          0x30, 0x02,          //GS c 0 0x02 --> Select roll paper
                                      0x1D,        0x56, (byte)CutType, 0x10 }; //ESC V 0x00 --> CUT Command
            string        test    = System.Text.Encoding.UTF8.GetString(c_bytes);
            SerialPrinter printer = new SerialPrinter("\\\\.\\" + DirPrintWatcher.Settings.SerialPort);

            printer.Print(c_bytes);
            printer.Cleanup();
        }
Example #2
0
        private void Print(string file)
        {
            StreamReader  sr      = null;
            SerialPrinter printer = new SerialPrinter("\\\\.\\" + DirPrintWatcher.Settings.SerialPort);

            try
            {
                sr = new StreamReader(file);
                printer.Print(sr);
            }
            finally
            {
                if (sr != null)
                {
                    sr.Close();
                }
                printer.Cleanup();
            }
        }