2013-04-22 2 views
0

나는 bill을 인쇄하는 asp.net에서 프로젝트를 가지고있다. 내 자신의 인쇄 클래스 PrintDocument 양식 System.Drawing.Printing 상속 된 만들고 Visual Studio 개발 서버에서 잘 작동합니다. 그러나 IIS에서 배포 한 후에는 작동하지 않습니다. 꽤 많은 연구 끝에 System.Drawing.Printing이 asp.net에서 작동하지 않는다는 것을 발견했습니다. 몇 가지 조작으로 인쇄 할 때 동일한 클래스를 사용할 수있는 방법이 있습니까? 아니면 (자바 스크립트 외에) 가능한 옵션은 무엇입니까? 인쇄는 IIS 서버를 호스팅하는 로컬 컴퓨터에서 수행해야합니다.iis에서 배포 한 후 printdocument 클래스를 작동시키는 방법은 무엇입니까?

답변

0

나는 당신이 System.Printing.PrintQueue을 사용하여 그렇게 할 수 있다고 믿습니다.

System.Printing.PrintServer("PrintServerName").PrintQueueCollection은 모두 PrintQueue입니다.

// 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); 

여기 PrintQueue

의 개념에 a good reference있어 : 다음은 MSDN에서 몇 가지 예제 코드는
관련 문제