private void DocToPdf() { PrintDocument pdDoc = new PrintDocument(); try { pdDoc.DocumentName = @"C:\Input.doc"; pdDoc.PrinterSettings.PrintToFile = true; pdDoc.PrinterSettings.PrintFileName = @"C:\Output.pdf"; pdDoc.PrinterSettings.PrinterName = "My_printer"; pdDoc.DefaultPageSettings = new PageSettings(new PrinterSettings()); pdDoc.PrintPage += new PrintPageEventHandler(pdDoc_PrintPage); pdDoc.BeginPrint += new PrintEventHandler(pdDoc_BeginPrint); pdDoc.QueryPageSettings += new QueryPageSettingsEventHandler(pdDoc_QueryPageSettings); pdDoc.EndPrint += new PrintEventHandler(pdDoc_EndPrint); if (pdDoc.PrinterSettings.IsValid) pdDoc.Print(); } catch (Exception ex) { string msg = ex.Message; } }
PrintPage()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)