Force printing in Black and white

  • Thread starter Thread starter Brian Cook
  • Start date Start date
Brian,

Are you in control of the application, or are you trying to do this
through another application?
 
Yes I am developing the application.

The customer wanted the RichTextBox background as Black, and the text in
Green. Printing is ugly with those color choices.


Nicholas Paldino said:
Brian,

Are you in control of the application, or are you trying to do this
through another application?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Brian Cook said:
Is there a way to force printing in black and white programatically?
 
Yes I am developing the application.

The customer wanted the RichTextBox background as Black, and the text in
Green. Printing is ugly with those color choices.

You can set the PageSettings.Color property to false when printing to
disable color printing.

However, keep in mind that this isn't going to change "ugly" into
"pretty". :) In the example you offer, one of two things will happen:

1) the printout will be converted to grayscale
2) the printout will be "posterized" (or quantized...basically, colors
converted to some closest matching shade of gray, possibly selected only
from black and white)

What happens exactly probably depends on the printer. Even in case #1,
you may find the text difficult to read, because green will come out as
some shade of gray. In case #2, green could actually get mapped to black,
making the text invisible.

IMHO, for situations like this, if you care about the quality of the
printout you need to add custom-handling code to change the colors before
printing so that you get a more readable printout. Depending on what
you're printing, you may have to modify the object being printed itself,
create a cloned object used for printing, or just include
printing-specific logic inside the object's drawing code.

As a first pass, you might just disable any background coloring when
printing. This will address most of the basic contrast issues you might
run into, and is a fairly common technique. It has the added benefit of
reducing ink/toner consumption (less ink is especially helpful, not just
because of the cost but also because you won't get a soggy mess of a
printout :) ).

Of course, make the behavior controllable by the user. You never know
when you'll have a user that really wants bad-looking printouts. :)

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top