Printer Preferences Dialog

  • Thread starter Thread starter Sadik Eser
  • Start date Start date
S

Sadik Eser

Hi,

I want to change the printer setting before printing,
i.e. using grayscale printing, instead of colorfull printing.
However, I should do it programatically, the users of my program would not
change this property.

Thanks..
 
Sadık Eser said:
Hi,

I want to change the printer setting before printing,
i.e. using grayscale printing, instead of colorfull printing.
However, I should do it programatically, the users of my program would not
change this property.

Thanks..

Hi,

You can either use your own PrinterSettings when specifying the
PrintDocument or override in the PrintPage event.

PrintDocument doc = new PrintDocument();
PrinterSettings settings = new PrinterSettings();
settings.DefaultPageSettings.Color = false;
doc.PrinterSettings = settings;
doc.PrintPage += new PrintPageEventHandler(doc_PrintPage);
doc.Print();

.... or ...

void doc_PrintPage(object sender, PrintPageEventArgs e)
{
e.PageSettings.Color = false;
e.Graphics.DrawString("Hello world", Font, Brushes.Magenta, new
Point(50, 50));
}

Either way should print "Hello world" in gray.
 
Back
Top