We are attempting to add multiple PDFs to a print job and need to differentiate the tray numbers for specific documents in the print job. I have reviewed the examples provided with the download to implement this functionality and everything seemed relatively straight forward (specifically the "PrintChangeTrayForPage". However, I am running into an issue now while attempting to add the pages (in the Pages property) from an object of type InputPdf. I have pasted the code below to give a better understanding of what we are doing.
_print_job = new PrintJob(PrinterName);
_print_job.PrintOptions.Scaling = new AutoPageScaling();
_print_job.PrintOptions.DuplexMode = DuplexMode.DuplexVertical;
_print_job.DocumentName = _job_name;
_print_job.Succeeded += _print_job_Succeeded;
_print_job.Failed += _print_job_Failed;
if (!Documents.Any()) {
return;
}
foreach (PrintDocument docToPrint in Documents) {
var pdf = new InputPdf(docToPrint.FilePath);
foreach (var page in pdf.Pages) {
PrintJobPage pjp = _print_job.Pages.Add(page);
pjp.PrintOptions.Inherit = false;
// update the paper source by the trayname on the page to print if it is not empty
if (!string.IsNullOrWhiteSpace(docToPrint.TrayName)) { pjp.PrintOptions.SetPaperSourceByName(docToPrint.TrayName);
}
}
}
Please let me know if you have any questions on the code above and I can elaborate.
The problem is that when the code reaches the _print_job.Pages.Add(page) line the page variable is null. What am I doing wrong? Is this the appropriate way to go about doing what we are attempting to achieve?
Thanks in advance!
Pages property on InputPdf class returning null
Re: Pages property on InputPdf class returning null
Support · Apr 16, 2014Hello,
We are investigating this issue on our end and we will be posting updates once we are done with our testing.
Thanks,
ceTe Software Support Team.
Re: Pages property on InputPdf class returning null
Support · Apr 29, 2014Hello,
This issue is resolved and a new build that contains the fix is released on our website. If you are evaluating the product please download it here
. If you already own a license, please login to the customer area
to download the build.
Thanks,
ceTe Software Support Team.