1

I am printing to a color printer. The printer's default setting for color is black-and-white.
I have tried the following, but when I open the printer's preferences dialog, the color is still set to black-and-white. It also prints in black-and-white. I want the preferences dialog to reflect the changes made by code. What to do?

This code runs when I click on the 'Print' button:

If PrintDocument1.PrinterSettings.SupportsColor Then
    PrintDocument1.DefaultPageSettings.Color = True
Else
    PrintDocument1.DefaultPageSettings.Color = False
End If

VB2010, GDI+, Winforms

5
  • Do favor implementing the PrintDocument.QueryPageSettings event instead, as shown in the MSDN library article. If it still doesn't work then you'll need to find another printer driver for the printer. May 18, 2013 at 22:27
  • 2
    Nope. I have tried putting e.PageSettings.Color = True into QueryPageSettings and PrintPage events, and it still prints B&W. The Printing Preferences also shows B&W. The only way to print color is to manually set it in Printing Preferences. BTW, the only examples I found on the web force B&W printing, not color printing, so I don't know...
    – mcu
    May 18, 2013 at 22:54
  • it's only work for your app .. not changes the printer preference setting
    – matzone
    May 19, 2013 at 3:37
  • 1
    Except it does not print in color, so it does not work. I do not want to change the printer's default settings, but the Preferences dialog should reflect how the job will be printed.
    – mcu
    May 19, 2013 at 13:35
  • Looks like a .NET bug. See here.
    – mcu
    Jun 17, 2013 at 5:02

1 Answer 1

0

In my case it turned out that my organization has a policy (I suppose as part of AD? Or maybe it's a print server setting?) to ignore all color settings and default all printing to black/white unless the user specifies color in the print dialog. The reason for this is that many printing applications default to color on all documents (most of which don't need color). So it really does make sense as a cost saving practice. This may not be your problem, but I suspect other organizations probably have the same configuration we do and may find this info useful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.