public void PrintDocument(string filepath) { //PrintDialog pd = new PrintDialog(); printProcess.StartInfo.FileName = filepath; //Also tried usecellexcecution=false; //Redirect=true; something like this printProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; printProcess.StartInfo.Verb = "Print"; printProcess.StartInfo.CreateNoWindow = true; PrinterSettings setting = new PrinterSettings(); setting.DefaultPageSettings.Landscape = true; printProcess.Start(); printProcess.CloseMainWindow(); }
doc.PrintController = new StandardPrintController(); doc.Print();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)