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); }
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()); }