1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | private void button1_Click(object sender, EventArgs e) { System.Windows.Forms.Printing.SimplePrintDocument prn = new System.Windows.Forms.Printing.SimplePrintDocument(); docuprinter.SDK DPSDK = new docuprinter.SDK(); prn.FontName = "Times New Roman"; prn.FontSize = 48; prn.DrawText(0, 0, "Hello from VC# !!!"); DPSDK.DocumentOutputFormat = "PDF"; DPSDK.DocumentOutputFolder = @"c:\users\public\"; DPSDK.DocumentOutputName = "testCSHARP"; DPSDK.HideSaveAsWindow=true; DPSDK.DefaultAction=1; DPSDK.ApplySettings(); prn.PrinterSettings.PrinterName = "docuPrinter"; prn.Print(); int RVal = DPSDK.Create(100); prn = null; DPSDK = null; if (RVal != 0) { MessageBox.Show("There was an error!!! Rval=" + RVal.ToString()); } else { MessageBox.Show("Done !!!"); } } |