Printing: preview perfect, printout misaligned

T

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
 
R

Ron Allen

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
 
T

Tim

Thanks Ron,

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

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top