string UrlName = Url.ToString(); string DownloadFilePath = @filePath+"\\"+FileName; if (File.Exists(DownloadFilePath)) { File.Delete(DownloadFilePath); } //Downloading file from Http Url WebClient myWebClient = new WebClient(); myWebClient.DownloadFile(UrlName, DownloadFilePath); System.Threading.Thread.Sleep(1000); //Code for Print the PDF file Process P = new Process(); P.StartInfo.FileName = DownloadFilePath; // FileName(.pdf) to print. P.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; //Hide the window. P.StartInfo.Verb = "Print"; PrintDialog pd = new PrintDialog(); //PrinterSettings setting = new PrinterSettings(); P.StartInfo.Arguments = pd.PrinterSettings.PrinterName.ToString(); pd.PrinterSettings.MaximumPage = 1; P.StartInfo.CreateNoWindow = true; //!! Don't create a Window. P.Start(); P.WaitForExit(4000); P.CloseMainWindow();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)