Printer Preferences Dialog

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sadik Eser

    Printer Preferences Dialog

    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..

  • =?Utf-8?B?TW9ydGVuIFdlbm5ldmlrIFtDIyBNVlBd?=

    #2
    RE: Printer Preferences Dialog


    "Sadık Eser" wrote:
    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.Defaul tPageSettings.C olor = false;
    doc.PrinterSett ings = settings;
    doc.PrintPage += new PrintPageEventH andler(doc_Prin tPage);
    doc.Print();

    .... or ...

    void doc_PrintPage(o bject sender, PrintPageEventA rgs e)
    {
    e.PageSettings. Color = false;
    e.Graphics.Draw String("Hello world", Font, Brushes.Magenta , new
    Point(50, 50));
    }

    Either way should print "Hello world" in gray.

    --
    Happy Coding!
    Morten Wennevik [C# MVP]

    Comment

    Working...