Hi,
I am working on a small windows desktop application that will load a pdf document and print it to a designated printer and tray. I am using a PdfDocuement object to do this and using the Print Method. I need to be able to do this silently so I am passing in a Printer Settings object with the PrinterSettings.DefaultPageSettings.PaperSource assigned to the desired PaperSource. I have also tried creating a separate PageSettings object and changing the PageSettings.PaperSource to the desired value (sample below). However, when these are sent to the printer the "Auto Select" tray is being used.
Code: C#
PageSettings page_settings = new PageSettings(print_options);
page_settings.PaperSource = print_options.PaperSources[3];
//changing the value in the square braces does not impact the tray used - tested (0, 2,3,4)
var mtask = PDFDoc.Print(print_options, page_settings);
mtask.WaitOne(-1);
Interestingly, if I do not use Silent printing and allow the print dialog to show I am able to make a print tray selection.