I want PDF file print into network print
I want PDF file print into network print Following code where used, it work fine in local host (development area) but not worked in IIS serve host Can given to any rights issue? How t开发者_Go百科o solve the issue ?
private void SendToPrinter()
{
ProcessStartInfo info = new ProcessStartInfo();
info.Verb = "print";
info.FileName = @"c:\output.pdf";
info.CreateNoWindow = true;
info.WindowStyle = ProcessWindowStyle.Hidden;
Process p = new Process();
p.StartInfo = info;
p.Start();
p.WaitForInputIdle();
System.Threading.Thread.Sleep(3000);
if (false == p.CloseMainWindow())
p.Kill();
}
It might be an authorization/security problem. IIS (the server) runs in a context which doesn't have access to the shared printer. Your local host has it cause it's running in your user's context.
精彩评论