Beispiel #1
0
        public void GenerarTicket()
        {
            try
            {
                //StreamReader stream = new StreamReader(@"./codigo.png");

                //PictureBox pb2 = new PictureBox();
                Ticket ticket = new Ticket();
                //pb2.Image = Image.FromStream(stream.BaseStream);
                ticket.HeaderImage = SisPro.Properties.Resources.logo;

                ticket.AddDatos("=================", "==================");
                ticket.AddDatos("", "");
                ticket.AddDatos("Nombre:  ", "");
                ticket.AddDatos("", Nombre);
                if (Matricula != "")
                {
                    ticket.AddDatos("Matricula:", "");
                    ticket.AddDatos("", Matricula);
                }
                ticket.AddDatos("Departamento:  ", "");
                ticket.AddDatos("", Departamento.NombreDepto);
                ticket.AddDatos("Fecha:", "");
                ticket.AddDatos("", Fecha.ToString("MM-dd-yyyy"));
                ticket.AddDatos("Hora:", "");
                ticket.AddDatos("", HoraLlegada.ToString("HH:mm:ss"));
                ticket.AddDatos("=================", "==================");
                ticket.AddTitulo("No #" + Numero);
                ticket.AddFooter("=================", "==================");
                //ticket.FooterImage = pb2.Image;
                ticket.PrintTicket(impresora);

                //ticket.PrintTicket();
                //stream.Close();
            }
            catch (Exception e)
            {
            }
        }