473,396 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Laser Printer Problem for printing an image in C#

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);
Nov 16 '05 #1
1 2557
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

"Mina Gohari" <mg*****@yahoo.com> wrote in message
news:#a**************@TK2MSFTNGP15.phx.gbl...
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);


bmp.DrawRectangle(Pens.Black, 980, 665, 120, 30);
bmp.DrawString("Ù.شاÙ^رÙ? Ø¢Ù.Ù^زشÛO", subTitle, Brushes.Black,
1040, 665, titleFr);
bmp.DrawString("http://www.olgou.com", new Font("Arial", 13,
FontStyle.Underline), Brushes.Blue, 900, 795);
bmpi.RotateFlip(RotateFlipType.Rotate90FlipNone);
e.Graphics.DrawImage(bmpi, 0.0f, 0.0f, 827.0f, 1169.0f);

any help is appreciated.

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gary | last post by:
Hi all, Can anyone point me to a sample on how to print a picture box image to a printer or do you have sample code that could show me? Thanks, Gary
2
by: qumpus | last post by:
My program right now generates USPS style shipping label using System.Drawing.Graphics. It works fine except that the printer prints really slowly. I want to make my program take advantage of true...
0
by: Tessa | last post by:
Is there any security reason why you cannot print to a network printer from ASP.NET under IIS6 on Windows 2003 server? I'm using ASP.NET code to print to a server print queue using...
1
by: HardWorker | last post by:
My OnDraw() shows a bitmap via pDC->StretchBlt(), and when I send it to an inkjet printer it looks fine. But when I send it to a laser printer, the picture is gone -- but text and lines that I...
4
by: c_shah | last post by:
How to change and set default printer using Visual Basic 2005 The following works within my VB 2005 application but does any one have better alternative. /**** Dim wshnetwork As Object =...
5
by: Raman | last post by:
Hello friends, I want to print an ID card. I have one Windows Form that contains front and back side. The printer is printing both front and back side at a time. I am trying to send both sides...
2
by: cjreynolds | last post by:
Please excuse my cluelessness on the subject - this is the first time I've worked with printing in VB (and it may be the last) and the more I work with it, the more confused I become... First, I'm...
1
by: deric | last post by:
Hi! I'm new to VB.net programming on printing a page to a thermal printer (Epson T88IV). I really had a hard time figuring out how to code the printing of a bitmap image and some text, while sending...
4
by: josephlapuz | last post by:
Hi people, can someone help me on this label zebra f*ck printer? I'm using the old zebra t300 printer for printing pharmacy labels. it prints well using printdocument of visual C#.net 2005. but it...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.