المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : print page with colored text in monochrome printer



C# Programming
05-04-2009, 09:31 PM
Hi to all,

I have a problem with a monochrome printer. ( samnung SCX-4x21 series)
I have a program that write a report on a printer. ( the content of the report consist of colored text and graphic objects ; I mean plain text, lines, rectangles , images..)

The problem is when I print the report on a monochrome printer. In this case for the objects with a black property color the rendering to the printer is ok , but for the objects with colored property the rendering to the printer is wrong. What is printed is a dirty gray color with wrong grain points.

I thought by myself that a monochrome printer translate a colored page content in a monochrome color automatically. doesn't it steel true? or am I wrong something?.

My snippet code is :
...

Printer = new System.Drawing.Printing.PrintDocument();
Printer.BeginPrint += new PrintEventHandler(doc_BeginPrint);
Printer.PrintPage += new PrintPageEventHandler(doc_PrintPage);
Printer.EndPrint += new PrintEventHandler(doc_EndPrint);
PrintController standard = new StandardPrintController();
Printer.PrintController = standard;

void doc_BeginPrint(object sender, PrintEventArgs e)
{
Printer.PrinterSettings.DefaultPageSettings.Color = false;
}
void doc_EndPrint(object sender, PrintEventArgs e)
{
}
void doc_PrintPage(object sender, PrintPageEventArgs e)
{
Pen ePen = new System.Drawing.Pen(Color.Orange, 1);
Font eFont = new System.Drawing.Font("Tahoma",08,FontStyle.Regular);
SolidBrush eBrush = new SolidBrush(Color.Red);

e.Graphics.DrawRectangle(FCanvasPen, e.MarginBounds.X, e.MarginBounds.Y, e.MarginBounds.Width, e.MarginBounds.Height);
e.Graphics.DrawString("some text", eFont , eBrush , 220, 50);

eFont.Dispose();
eBrush.Dispose();
ePen.Dispose();
e.HasMorePages = false;
}

Probably is a stupid question, but i can't get rid of.
Could someone help me to solve