Posted by a ceTe Software moderator
Hello,
The DynamicPDF Generator/Merger products allow you to generate PDFs from scratch and merge the existing PDFs.
In order to print the PDFs to a specific printer, you will need to use the
DynamicPDF PrintManager for .NET product. You can achieve your requirement by specifying the paper source for the PDF pages dynamically. Please refer to the documentation on PaperSource class of PrintManager API
here. Also below is the code sample for setting different paper sources(tray/drawer) to different pages.
Also you will need to know what paper size is placed in the each trays of Printer and set the paper source to the PrintJobPage accordingly.
//code sample for setting the PaperSornce .
InputPdf pdf = new InputPdf(@"Path for Input PDF");
Printer printerObj = new Printer("Printer name");
PrintJob printJobObj = new PrintJob(printerObj, pdf);
//Code sample for setting paper source for whole print job.
printJobObj.PrintOptions.PaperSource = printerObj.PaperSources[1];
//Code sample for setting specific tray as papersource for first page in the printjob.
PrintJobPage page1 = printJobObj.Pages[0];
page1.PrintOptions.Inherit = false;
page1.PrintOptions.PaperSource = printerObj.PaperSources[2];
//Code sample for setting specific tray as papersource for second page in the printjob.
PrintJobPage page2 = printJobObj.Pages[1];
page2.PrintOptions.Inherit = false;
page2.PrintOptions.PaperSource = printerObj.PaperSources[3];
printJobObj.Print();
Thanks,
ceTe Software Support Team.