2016-07-26 15 views
0

PDF를 인쇄하려고하는 Web Forms를 사용하는 ASP.NET 응용 프로그램이 있습니다. 현재 DynamicPDF를 사용하여 새 탭에서 해당 PDF를 생성하지만 당사의 동적 PDF 모듈은 인쇄를 처리하지 않습니다.ASP.NET 웹 양식 응용 프로그램에서 PDF 페이지의 용지 공급 설정

두 페이지 PDF를 인쇄해야합니다. 첫 번째 페이지는 봉투 용이어야하며 두 번째 페이지는 일반 용지처럼 일반 용지를 인쇄해야합니다. 누구든지 코드에서 그 종이 소스를 설정하는 방법을 알고 있습니까? 이상 적으로는 웹 페이지에서 인쇄를하고 프린터는 첫 페이지 봉투와 두 번째 페이지를 인쇄하는 것을 알고 있습니다. 사용자가 무언가를 인쇄 할 때마다 그 설정을 변경하도록하는 것은 큰 어려움입니다. 어떤 아이디어 또는 이것을 달성 할 수있는 도구?

감사합니다.

답변

1

PDF를 특정 프린터로 인쇄하려면 DynamicPDF PrintManager for .NET 제품을 사용해야합니다. 다음과 같이 런타임 중에 각 페이지의 용지 소스를 지정할 수 있습니다.

 InputPdf pdf = new InputPdf(@"Path for Input PDF"); 
     Printer printerObj = new Printer("Printer name"); 
     PrintJob printJobObj = new PrintJob(printerObj, pdf); 

     //Setting paper source for whole print job. 
     printJobObj.PrintOptions.PaperSource = printerObj.PaperSources[1]; 

     //Setting specific tray as paper source for first page in the print job. 
     PrintJobPage page1 = printJobObj.Pages[0]; 
     page1.PrintOptions.Inherit = false; 
     page1.PrintOptions.PaperSource = printerObj.PaperSources[2]; 

     //Setting specific tray as paper source for second page in the print job. 
     PrintJobPage page2 = printJobObj.Pages[1]; 
     page2.PrintOptions.Inherit = false; 
     page2.PrintOptions.PaperSource = printerObj.PaperSources[3]; 

     printJobObj.Print(); 

면책 조항 : 저는 DynamicPDF 라이브러리를 개발하는 회사 인 ceTe Software에서 근무하고 있습니다.