Laser Printer Problem for printing an image in C#

  • Thread starter Thread starter Mina Gohari
  • Start date Start date
M

Mina Gohari

Hi all

I have a problem with printing a report card to laser printer.
Everything works properly on ink-jet printer, but when I use laser
printer , it's not in predifined format. everything is mix-up.


Bitmap bmpi = new Bitmap(1169, 827);
Graphics bmp = Graphics.FromImage(bmpi);

bmp.FillRectangle(Brushes.Gray, 20.0F, 140.0F, 1130.0F, 510.0F);
bmp.FillRectangle(Brushes.White, 10.0F, 130.0F, 1130.0F, 510.0F);
 
Hello

If the units of the numbers in your program is pixels, then the reason of
the problem might be that you are hardcoding the values in the code. These
values may work well with your ink-jet printer which has a most probably has
a different resolution than your laser printer. The solution is either use a
unit that's doesn't change from device to another such as millimeters, or
detect the printer resolution at runtime and scale the values according the
the resolution.

Best regards,
Sherif
 
Back
Top