2013-04-22 41 views
0

我有在asp.net打印賬單的項目。我已經制作了我自己的Printing類,繼承自PrintDocument表單System.Drawing.Printing,它在Visual Studio開發服務器中工作正常。但是,在IIS中部署後它不起作用。 經過相當多的研究後,我發現System.Drawing.Printing不適用於asp.net。 有沒有什麼辦法可以使用相同的類進行一些調整打印....或 什麼可能的選擇(除了JavaScript)? 打印將在本身託管IIS服務器的本地計算機上完成。如何使printdocument類在iis中部署後工作?

回答

0

我相信你可以使用System.Printing.PrintQueue來做到這一點。

System.Printing.PrintServer("PrintServerName").PrintQueueCollection會給你所有可用的PrintQueue s。下面是從MSDN一些示例代碼:

// Create a PrintServer 
// "theServer" must be a print server to which the user has full print access. 
PrintServer myPrintServer = new PrintServer(@"\\theServer"); 

// List the print server's queues 
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues(); 
String printQueueNames = "My Print Queues:\n\n"; 
foreach (PrintQueue pq in myPrintQueues) 
{ 
    printQueueNames += "\t" + pq.Name + "\n"; 
} 
Console.WriteLine(printQueueNames); 

下面是關於概念a good reference背後PrintQueue小號

相關問題