开发者

I want PDF file print into network print

开发者 https://www.devze.com 2023-03-09 00:06 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消