We are trying to send the same PDF, page 1 to a tray and all other pages to another tray. This doesn't seem to work to well.
public void PrintAllPdfUsingOneDoc()
{
//Convert Pdf content to Pdf doc
ceTe.DynamicPDF.Printing.InputPdf _pdfDoc = new ceTe.DynamicPDF.Printing.InputPdf(_printConfig.PDFContent);
_pageCount = _pdfDoc.Pages.Count;
//Create a print job for check page
var _printer = new Printer(_printConfig.CheckPrinterName);
var _checkPaperSource = _printer.PaperSources.FirstOrDefault(x => x.Name == _printConfig.CheckPaperSource.SourceName);
var _tailPaperSource = _printer.PaperSources.FirstOrDefault(x => x.Name == _printConfig.TailPaperSource.SourceName);
ceTe.DynamicPDF.Printing.PrintJob _printJob = new ceTe.DynamicPDF.Printing.PrintJob(_printer, _pdfDoc);
_printJob.PrintOptions.PaperSource = _tailPaperSource;
////PrintOptions for the check page
_printJob.Pages[0].PrintOptions.Inherit = false;
_printJob.Pages[0].PrintOptions.PaperSource = _checkPaperSource;
if(_pageCount > 1)
{
//PrintOptions for the tail pages
for (int i = 1; i < _pageCount; i++)
{
_printJob.Pages[i].PrintOptions.Inherit = false;
_printJob.Pages[i].PrintOptions.PaperSource = _tailPaperSource;
}
}
_printJob.Print();
_log.Info(string.Format("Check page printing at printer: {0} using tray: {1} with JobID: {2}", _printJob.Printer.Name.ToString(), _printJob.PrintOptions.PaperSource.Name.ToString(), _printJob.JobId));
_printJob.Dispose();
}
Any suggestions?