Welcome Guest Search | Active Topics | Sign In | Register

PDFDocument.Print Printer Tray Selection Options
Greg
Posted: Thursday, May 11, 2017 8:11:57 AM
Rank: Newbie
Groups: Member

Joined: 5/11/2017
Posts: 2
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.
eo_support
Posted: Thursday, May 11, 2017 11:26:35 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

We looked into this. Chromium browser engine does not set paper source at all (corresponding to dmDefaultSource member of the DEVMOD) structure, so any paper source setting you passed in would be ignored. You can try to set the default paper source of the printer to your desired source through Windows API (and possibly PageSetting.CopyToHdevMode method) before you call Print and restore the previous value when your application exit.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.