为了将 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 工作。