469,625 Members | 1,094 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

Printing: preview perfect, printout misaligned

Tim
Hi,

I have created some code for printing a column report. The default page size
is 850 x 1100, which is correct. The print preview looks perfect. The data
is positioned exactly where it should be. (centered)

When I go to print however, the data is shifted to the right. About a
margin's worth. I set the margins at 50 and it looks like it is at 100.

I checked the code and the starting X position is at 50. So why is it
printing misaligned?

Can anyone offer any suggestions? I am printing on an 8.5 X 11 sheet of
paper on a laser printer. I have tried it on a different printer with the
same results.

Thanks

Tim
Nov 17 '05 #1
2 2024
Tim,
You have encountered the 'hard' margins of the printer. Basically the
drawing area on the printer is starting at the top/left hard margin instead
of the paper's top left when output is to the printer. Search for
GetHardMargins in microsoft.public.dotnet.framework.drawing to find a
function to load these margins. You can then compensate for this by calling
TranslateTransform on the Graphics with the negative of the margin values
and things will work the same.
If you can't find the code (or can only find a VB.NET versioin) I can
post it here again.

Ron Allen
"Tim" <ti*@home.com> wrote in message
news:JJ*******************@news20.bellglobal.com.. .
Hi,

I have created some code for printing a column report. The default page
size is 850 x 1100, which is correct. The print preview looks perfect. The
data is positioned exactly where it should be. (centered)

When I go to print however, the data is shifted to the right. About a
margin's worth. I set the margins at 50 and it looks like it is at 100.

I checked the code and the starting X position is at 50. So why is it
printing misaligned?

Can anyone offer any suggestions? I am printing on an 8.5 X 11 sheet of
paper on a laser printer. I have tried it on a different printer with the
same results.

Thanks

Tim

Nov 17 '05 #2
Tim
Thanks Ron,

I am looking into it now. I have found some code and I am trying it out...

Tim

"Ron Allen" <rallen@_nospam_src-us.com> wrote in message
news:Oj*************@TK2MSFTNGP11.phx.gbl...
Tim,
You have encountered the 'hard' margins of the printer. Basically the
drawing area on the printer is starting at the top/left hard margin
instead of the paper's top left when output is to the printer. Search for
GetHardMargins in microsoft.public.dotnet.framework.drawing to find a
function to load these margins. You can then compensate for this by
calling TranslateTransform on the Graphics with the negative of the margin
values and things will work the same.
If you can't find the code (or can only find a VB.NET versioin) I can
post it here again.

Ron Allen
"Tim" <ti*@home.com> wrote in message
news:JJ*******************@news20.bellglobal.com.. .
Hi,

I have created some code for printing a column report. The default page
size is 850 x 1100, which is correct. The print preview looks perfect.
The data is positioned exactly where it should be. (centered)

When I go to print however, the data is shifted to the right. About a
margin's worth. I set the margins at 50 and it looks like it is at 100.

I checked the code and the starting X position is at 50. So why is it
printing misaligned?

Can anyone offer any suggestions? I am printing on an 8.5 X 11 sheet of
paper on a laser printer. I have tried it on a different printer with the
same results.

Thanks

Tim


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Mario | last post: by
5 posts views Thread by Stefania Scott | last post: by
reply views Thread by Karthik | last post: by
8 posts views Thread by Tinus | last post: by
4 posts views Thread by scorpion53061 | last post: by
3 posts views Thread by =?Utf-8?B?QnJpYW4gQ29vaw==?= | last post: by
3 posts views Thread by franc sutherland | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.