views:

6

answers:

0

I have a Windows printer configured using a PPD based driver (see Wikipedia).

The PPD file defines Duplex as being supported and the duplex setting can be changed via the Printer's Printing Preferences (right click on the printer and choose properties). I have confirmed the setting works by printing a two page document.

The problem I have is programmatically reading the Printer's duplex setting.

.NET's System.Drawing.Printing.PrinterSettings.CanDuplex is always false.

System.Drawing.Printing.PrinterSettings settings = new System.Drawing.Printing.PrinterSettings();
settings.PrinterName = "My Printer";
bool duplexSupported=settings.CanDuplex;

The Windows API function DeviceCapabilites() with DC_DUPLEX and the DEVMODE structure returned by DocumentProperties() both report Duplex as not supported by the printer. No surprise there as it's highly likely the .NET methods also use these API calls.

I've had a good look round and the only solution I can find is to not use the PPD Driver. This is not really an option as it would force users to change their printer drivers.

Has anybody come across this situation before? Maybe there is an alternative method for reading printer capabilities, but I haven't found one.