user1483326
user1483326

Reputation: 61

How can I tell if a printer will print to file?

I have a .net 2.0 application (c#) with one component running as a service and a UI for configuring the service.

The UI provides a way for the user to select a printer which will be used by the service.

I want the UI to filter out any printers which are configured to print to file becasue these pritners will cause problems for the service (a 'save as' dialog will open but the dialog is invisible becasue it belongs to the service).

The problem is that I can't find any method to detect a printer which is set to print to file.

System.Drawing.Printing.PrinterSettings has a property called PrintToFile, but this is always set to false!

Upvotes: 6

Views: 1782

Answers (1)

mrd
mrd

Reputation: 2183

PrinterSettings.PrintToFile can only be set by System.Windows.Forms.Printing.PrintDialog class. The Print to file option only appears on the System.Windows.Forms.Printing.PrintDialog when the System.Windows.Forms.Printing.PrintDialog.AllowPrintToFile property is set to true.

Hope that solves your problem.

Upvotes: 1

Related Questions