我使用itextsharp生成pdf并打印pdf。 当我从Visual Studio打印项目时,打印命令正在运行。
当我在iis中托管项目并从远程PC访问网页时,Print Command无效。
我正在使用以下代码进行打印
Process printjob = new Process();
printjob.StartInfo.FileName = Server.MapPath("~/App_Data/") + "Document" + Month + "-" + Year + ".pdf"; //path of your file;
printjob.StartInfo.Verb = "Print";
printjob.StartInfo.CreateNoWindow = true;
printjob.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
PrinterSettings setting = new PrinterSettings();
setting.DefaultPageSettings.Landscape = true;
printjob.Start();