WPF list available printers and trays

2019-08-08 12:36发布

I'm writing WPF application which needs to display list of available Printers and corresponding trays.

I can able to get list of available printers by loop through the following line

PrinterSettings.InstalledPrinters

and now stuck up with getting corresponding printer trays. could anybody give sample code?

2条回答
放荡不羁爱自由
2楼-- · 2019-08-08 13:19

You are looking for PaperSources property - Gets the paper source trays that are available on the printer. (MSDN: http://msdn.microsoft.com/en-us/library/system.drawing.printing.printersettings%28v=vs.110%29.aspx)

查看更多
The star\"
3楼-- · 2019-08-08 13:37
    using System.Printing
    ......

    var printers = new LocalPrintServer().GetPrintQueues().Select(v => v.Name);
查看更多
登录 后发表回答