Exemplo n.º 1
0
        private void btEnviaTexto_Click(object sender, EventArgs e)
        {
            PrinterDriverBase driver  = (PrinterDriverBase)cbDriver.SelectedValue;
            PrinterService    service = new PrinterService(driver);

            service.Expand(ExpandType.Width);
            service.NewLine(service.PadCenter("Titulo"));
            service.WriteText(txTexto.Text);
            service.Texto("»" + txTexto.Text);
            service.SingleSep();
            service.Flush("Documento de teste", 1);
        }
Exemplo n.º 2
0
        static void Main()
        {
            var driver  = new DefaultTextDriver("Microsoft Print to PDF");
            var service = new PrinterService(driver);

            service.Expand(ExpandType.Width);
            service.NewLine("linha");
            service.WriteText("Texto de teste");
            service.Flush("ArquivoDeTeste", 1);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Principal());
        }