How to determine if the printer will print to a file?

I have a .net 2.0 (C #) application with one component acting as a service and a user interface for configuring the service.

The user interface allows the user to select the printer that the service will use.

I want the user interface to filter out any printers that are configured to print to a file, because these parables will cause problems for the service (the "Save As" dialog box opens, but the dialog is invisible because it belongs to the service).

The problem is that I cannot find any method to detect the printer that is installed to print to a file.

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

+5
source share
1 answer

PrinterSettings.PrintToFile can only be set by the System.Windows.Forms.Printing.PrintDialog class. The Print to File option is displayed only in System.Windows.Forms.Printing.PrintDialog if the System.Windows.Forms.Printing.PrintDialog.AllowPrintToFile property is set to true.

Hope that solves your problem.

+1
source

All Articles