473,320 Members | 1,694 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,320 software developers and data experts.

I'm at a loss... Printing and margins?

Hello all,

Because you have been so helpfull the last couple of times, I thought after
testing and wasting more than 20 pages (and google-ling for 3 days :-( ). I
would ask you again for your help.

The problem is this:
If I print a rectangle which begins at (0,0) and the margins are also set to
0 (l:0, t:0, r:0, b:0) then it prints fine (ok, not quite because 0,0 is
inside the none printable area but I corrected for that by checking to see
if the margins are inside the non printable are and if so then correcting
for that otherwise I use the MarginBounds from the PrintEventArgs).

Now when I set the margins (using the PageSetupDialog) to e.g.: 1" (l:1",
t:1", r:1", b:1") then it prints incorrectly. The margin on the left and top
are almost double the size I specified: 1.75". And no, the non printable are
is not 0.75", it is only 0.2".

However if I set the margins to 1" but the rectangle x,y to 0,0 then the
print out is correct. The left and top margin are exactly 1".

So, for now I also have the rectangle set to (0, 0, MarginBounds.Width,
MarginBounds.Height) and the document comes out fine but the downside of
that is that the PrintPreview is incorrect (starts always on the upper left
corner: 0,0 which is obvious).

Hopefully someone here can help me again. I have a feeling I'm overlooking
something.
BTW: In MS Word a document with margins set to 1" (or something else) are
printed perfectly and is also correctly shown in the Print Preview. I.o.w.
my printer is not broken...

Thank you in advance!

With regards,
Tinus
- The Netherlands -
Nov 17 '05 #1
8 9553
You could try getting the MarginBounds from the PrintPageEventArgs and
pass that to your printing logic.

private void printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
...
e.MarginBounds,
...
}

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #2
Never mind. I see that you already tried this.

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3
Tinus,
I normally find the Hard Margins of the printer and then do a
TranslateTransform on the resulting graphics to get the drawing area setup
so that I can specify actual page coordinates. I check to see if the page
is being sent to the printer by checking to see if the
VisibleClipBounds.Height of the Graphics is less than the physical page
height and only then apply the transform. I've written some code to get the
HardMargins of the printer using PInvoke on GetDeviceCaps. You can probably
find it in the archives of microsoft.public.dotnet.framework.drawing or if
you can't find it I can post it for you. Assuming you have the code to get
hard margins the following works to do the transform if required.
--------------------------------------------------------------------------------------------------
// this is inside a PrintPage call -- all the stock items are setup in
OnBeginPrint
IntPtr hDc = ev.Graphics.GetHdc();
ev.Graphics.ReleaseHdc(hDc);
float left = 0.0f, right = 0.0f, top = 0.0f, bottom = 0.0f;
PrintUtils.GetHardMargins(hDc.ToInt32(), ref left, ref top, ref right,
ref bottom);
if (ev.Graphics.VisibleClipBounds.Height < 1100.0f)
{
ev.Graphics.TranslateTransform(-left, -top);
}
else
{
m_color = true; // printing to screen
ev.Graphics.TextRenderingHint =
System.Drawing.Text.TextRenderingHint.AntiAliasGri dFit;
}
--------------------------------------------------------------------------------------------------
Note that in FW 2.0 you can get this information using properties of the
Graphics including if the printing is being done to a PrintPreview without
all these calls.
Let me know if you need the GetHardMargins code.
Ron Allen
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in message
news:uA**************@TK2MSFTNGP15.phx.gbl...
Hello all,

Because you have been so helpfull the last couple of times, I thought
after testing and wasting more than 20 pages (and google-ling for 3 days
:-( ). I would ask you again for your help.

The problem is this:
If I print a rectangle which begins at (0,0) and the margins are also set
to 0 (l:0, t:0, r:0, b:0) then it prints fine (ok, not quite because 0,0
is inside the none printable area but I corrected for that by checking to
see if the margins are inside the non printable are and if so then
correcting for that otherwise I use the MarginBounds from the
PrintEventArgs).

Now when I set the margins (using the PageSetupDialog) to e.g.: 1" (l:1",
t:1", r:1", b:1") then it prints incorrectly. The margin on the left and
top are almost double the size I specified: 1.75". And no, the non
printable are is not 0.75", it is only 0.2".

However if I set the margins to 1" but the rectangle x,y to 0,0 then the
print out is correct. The left and top margin are exactly 1".

So, for now I also have the rectangle set to (0, 0, MarginBounds.Width,
MarginBounds.Height) and the document comes out fine but the downside of
that is that the PrintPreview is incorrect (starts always on the upper
left corner: 0,0 which is obvious).

Hopefully someone here can help me again. I have a feeling I'm overlooking
something.
BTW: In MS Word a document with margins set to 1" (or something else) are
printed perfectly and is also correctly shown in the Print Preview. I.o.w.
my printer is not broken...

Thank you in advance!

With regards,
Tinus
- The Netherlands -

Nov 17 '05 #4
Ron,
Thank you. I already found and using your GetDeviceCaps code. Works
perfectly.
The problem is that I have to set the upper left corner always to 0,0 even
when I set the upper corner margin to 1" I need to use 0,0. If I print with
margins set to 1" and the rectangle area to (0,0, MarginBounds.With,
MarginBounds.Height) then the actual printout is perfect (nice margin of 1"
on top and left side). However the Print Preview is incorrect -> displaying
the graphics in the upper most left corner (due to the 0,0 of the
rectangle).

So to solve this I need to check wether I'm in PrintPreview or I'm actually
printing it to the Printer, correct? So this is a bug or something? And I'm
not doing anything wrong?

WHat is the best way to know if I'm drawing to the actual Printer or to the
Print Preview?

Thank you,
Tinus

"Ron Allen" <rallen@_nospam_src-us.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Tinus,
I normally find the Hard Margins of the printer and then do a
TranslateTransform on the resulting graphics to get the drawing area setup
so that I can specify actual page coordinates. I check to see if the page
is being sent to the printer by checking to see if the
VisibleClipBounds.Height of the Graphics is less than the physical page
height and only then apply the transform. I've written some code to get
the HardMargins of the printer using PInvoke on GetDeviceCaps. You can
probably find it in the archives of
microsoft.public.dotnet.framework.drawing or if you can't find it I can
post it for you. Assuming you have the code to get hard margins the
following works to do the transform if required.
--------------------------------------------------------------------------------------------------
// this is inside a PrintPage call -- all the stock items are setup in
OnBeginPrint
IntPtr hDc = ev.Graphics.GetHdc();
ev.Graphics.ReleaseHdc(hDc);
float left = 0.0f, right = 0.0f, top = 0.0f, bottom = 0.0f;
PrintUtils.GetHardMargins(hDc.ToInt32(), ref left, ref top, ref right,
ref bottom);
if (ev.Graphics.VisibleClipBounds.Height < 1100.0f)
{
ev.Graphics.TranslateTransform(-left, -top);
}
else
{
m_color = true; // printing to screen
ev.Graphics.TextRenderingHint =
System.Drawing.Text.TextRenderingHint.AntiAliasGri dFit;
}
--------------------------------------------------------------------------------------------------
Note that in FW 2.0 you can get this information using properties of the
Graphics including if the printing is being done to a PrintPreview without
all these calls.
Let me know if you need the GetHardMargins code.
Ron Allen
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message news:uA**************@TK2MSFTNGP15.phx.gbl...
Hello all,

Because you have been so helpfull the last couple of times, I thought
after testing and wasting more than 20 pages (and google-ling for 3 days
:-( ). I would ask you again for your help.

The problem is this:
If I print a rectangle which begins at (0,0) and the margins are also set
to 0 (l:0, t:0, r:0, b:0) then it prints fine (ok, not quite because 0,0
is inside the none printable area but I corrected for that by checking to
see if the margins are inside the non printable are and if so then
correcting for that otherwise I use the MarginBounds from the
PrintEventArgs).

Now when I set the margins (using the PageSetupDialog) to e.g.: 1" (l:1",
t:1", r:1", b:1") then it prints incorrectly. The margin on the left and
top are almost double the size I specified: 1.75". And no, the non
printable are is not 0.75", it is only 0.2".

However if I set the margins to 1" but the rectangle x,y to 0,0 then the
print out is correct. The left and top margin are exactly 1".

So, for now I also have the rectangle set to (0, 0, MarginBounds.Width,
MarginBounds.Height) and the document comes out fine but the downside of
that is that the PrintPreview is incorrect (starts always on the upper
left corner: 0,0 which is obvious).

Hopefully someone here can help me again. I have a feeling I'm
overlooking something.
BTW: In MS Word a document with margins set to 1" (or something else) are
printed perfectly and is also correctly shown in the Print Preview.
I.o.w. my printer is not broken...

Thank you in advance!

With regards,
Tinus
- The Netherlands -


Nov 17 '05 #5
So, please let me explain in more detail what is hapening....

Page Setup: all Margins set to 1"
The e.MarginBounds.Left = 100 pixels
The e.MarginBounds.Top = 100 pixels

If I now print a Rectangle using(e.MarginBounds.Left, ...Top, ...Width,
....Height) then the actual printed margin is +/- 1.8" (so almost double the
size set using the Page Setup dialog).

Using Rons GetDeviceCaps I get a HardMarginLeft:11 pixels and Top: 13
pixels. So that can not be the problem: 0.8" is not 11 pixels;

If I however set the Margins again to 1" using the PageSetupDialog but draw
a Rectangle using (0, 0, e.MarginBounds.Width, ...Height) then the printout
is correct -> margins on the paper are 1" all around. However the Print
Preview is incorrect showing the draw rectangle in the upper left most
corner due to the (0,0) coordinate.

Hope someone knows what I'm doing wrong :-(

Thanks,
Tinus

"Ron Allen" <rallen@_nospam_src-us.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Tinus,
I normally find the Hard Margins of the printer and then do a
TranslateTransform on the resulting graphics to get the drawing area setup
so that I can specify actual page coordinates. I check to see if the page
is being sent to the printer by checking to see if the
VisibleClipBounds.Height of the Graphics is less than the physical page
height and only then apply the transform. I've written some code to get
the HardMargins of the printer using PInvoke on GetDeviceCaps. You can
probably find it in the archives of
microsoft.public.dotnet.framework.drawing or if you can't find it I can
post it for you. Assuming you have the code to get hard margins the
following works to do the transform if required.
--------------------------------------------------------------------------------------------------
// this is inside a PrintPage call -- all the stock items are setup in
OnBeginPrint
IntPtr hDc = ev.Graphics.GetHdc();
ev.Graphics.ReleaseHdc(hDc);
float left = 0.0f, right = 0.0f, top = 0.0f, bottom = 0.0f;
PrintUtils.GetHardMargins(hDc.ToInt32(), ref left, ref top, ref right,
ref bottom);
if (ev.Graphics.VisibleClipBounds.Height < 1100.0f)
{
ev.Graphics.TranslateTransform(-left, -top);
}
else
{
m_color = true; // printing to screen
ev.Graphics.TextRenderingHint =
System.Drawing.Text.TextRenderingHint.AntiAliasGri dFit;
}
--------------------------------------------------------------------------------------------------
Note that in FW 2.0 you can get this information using properties of the
Graphics including if the printing is being done to a PrintPreview without
all these calls.
Let me know if you need the GetHardMargins code.
Ron Allen
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message news:uA**************@TK2MSFTNGP15.phx.gbl...
Hello all,

Because you have been so helpfull the last couple of times, I thought
after testing and wasting more than 20 pages (and google-ling for 3 days
:-( ). I would ask you again for your help.

The problem is this:
If I print a rectangle which begins at (0,0) and the margins are also set
to 0 (l:0, t:0, r:0, b:0) then it prints fine (ok, not quite because 0,0
is inside the none printable area but I corrected for that by checking to
see if the margins are inside the non printable are and if so then
correcting for that otherwise I use the MarginBounds from the
PrintEventArgs).

Now when I set the margins (using the PageSetupDialog) to e.g.: 1" (l:1",
t:1", r:1", b:1") then it prints incorrectly. The margin on the left and
top are almost double the size I specified: 1.75". And no, the non
printable are is not 0.75", it is only 0.2".

However if I set the margins to 1" but the rectangle x,y to 0,0 then the
print out is correct. The left and top margin are exactly 1".

So, for now I also have the rectangle set to (0, 0, MarginBounds.Width,
MarginBounds.Height) and the document comes out fine but the downside of
that is that the PrintPreview is incorrect (starts always on the upper
left corner: 0,0 which is obvious).

Hopefully someone here can help me again. I have a feeling I'm
overlooking something.
BTW: In MS Word a document with margins set to 1" (or something else) are
printed perfectly and is also correctly shown in the Print Preview.
I.o.w. my printer is not broken...

Thank you in advance!

With regards,
Tinus
- The Netherlands -


Nov 17 '05 #6
Tinus,
I check for in PrintPreview by using the check on
VisibleClipBounds.Height in the previous code I sent. When this height is
less than the height of the page which is hardwired at 11" in my example I
then translate the Graphics so that the output origin is at 0,0 on the page.
My example is using the default 100dpi setting for device coordinates.
I don't normally change the document margins or do any drawing using
OriginAtMargins. I just translate the Graphics appropriately and then draw
in absolute coordinates so that if I specify 0.5"/0.5" that is where the
point will be located. For devices with smaller print areas like some
inkjet printers I also scale the output so that the whole output will fit in
the printable area.

Ron Allen
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in message
news:Oj**************@TK2MSFTNGP09.phx.gbl...
Ron,
Thank you. I already found and using your GetDeviceCaps code. Works
perfectly.
The problem is that I have to set the upper left corner always to 0,0 even
when I set the upper corner margin to 1" I need to use 0,0. If I print
with margins set to 1" and the rectangle area to (0,0, MarginBounds.With,
MarginBounds.Height) then the actual printout is perfect (nice margin of
1" on top and left side). However the Print Preview is incorrect ->
displaying the graphics in the upper most left corner (due to the 0,0 of
the rectangle).

So to solve this I need to check wether I'm in PrintPreview or I'm
actually printing it to the Printer, correct? So this is a bug or
something? And I'm not doing anything wrong?

WHat is the best way to know if I'm drawing to the actual Printer or to
the Print Preview?

Thank you,
Tinus

"Ron Allen" <rallen@_nospam_src-us.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Tinus,
I normally find the Hard Margins of the printer and then do a
TranslateTransform on the resulting graphics to get the drawing area
setup so that I can specify actual page coordinates. I check to see if
the page is being sent to the printer by checking to see if the
VisibleClipBounds.Height of the Graphics is less than the physical page
height and only then apply the transform. I've written some code to get
the HardMargins of the printer using PInvoke on GetDeviceCaps. You can
probably find it in the archives of
microsoft.public.dotnet.framework.drawing or if you can't find it I can
post it for you. Assuming you have the code to get hard margins the
following works to do the transform if required.
--------------------------------------------------------------------------------------------------
// this is inside a PrintPage call -- all the stock items are setup in
OnBeginPrint
IntPtr hDc = ev.Graphics.GetHdc();
ev.Graphics.ReleaseHdc(hDc);
float left = 0.0f, right = 0.0f, top = 0.0f, bottom = 0.0f;
PrintUtils.GetHardMargins(hDc.ToInt32(), ref left, ref top, ref right,
ref bottom);
if (ev.Graphics.VisibleClipBounds.Height < 1100.0f)
{
ev.Graphics.TranslateTransform(-left, -top);
}
else
{
m_color = true; // printing to screen
ev.Graphics.TextRenderingHint =
System.Drawing.Text.TextRenderingHint.AntiAliasGri dFit;
}
--------------------------------------------------------------------------------------------------
Note that in FW 2.0 you can get this information using properties of the
Graphics including if the printing is being done to a PrintPreview
without all these calls.
Let me know if you need the GetHardMargins code.
Ron Allen

------------------snip-------------------------------
Nov 17 '05 #7
Thanks,

I got it now. I do a (e.Graphics.VisibleClipBounds.Height <
e.PageSettings.PaperSize.Height) check. If true then I'm drawing to the
actual printer, if false I'm drawing to the Print Preview.

If I'm drawing to the Print Preview then I set the left and top margin to
e.MarginBounds (corrected for HardMargins) and if I'm drawing to the actual
Printer I set the left to (e.MarginBounds.Left >=
margins.HardMarginLeft)?(0):(margins.HardMargin) and the top to
(e.MarginBounds.Top >= margins.HardMarginTop)?(0):(margins.HardMarginTop) .

The above works (Preview and actual Print are correct) but I still think
it's a little bit strange :-(

Thanks again Ron!

Tinus

"Ron Allen" <rallen@_nospam_src-us.com> wrote in message
news:um**************@TK2MSFTNGP09.phx.gbl...
Tinus,
I check for in PrintPreview by using the check on
VisibleClipBounds.Height in the previous code I sent. When this height is
less than the height of the page which is hardwired at 11" in my example I
then translate the Graphics so that the output origin is at 0,0 on the
page. My example is using the default 100dpi setting for device
coordinates.
I don't normally change the document margins or do any drawing using
OriginAtMargins. I just translate the Graphics appropriately and then
draw in absolute coordinates so that if I specify 0.5"/0.5" that is where
the point will be located. For devices with smaller print areas like some
inkjet printers I also scale the output so that the whole output will fit
in the printable area.

Ron Allen
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message news:Oj**************@TK2MSFTNGP09.phx.gbl...
Ron,
Thank you. I already found and using your GetDeviceCaps code. Works
perfectly.
The problem is that I have to set the upper left corner always to 0,0
even when I set the upper corner margin to 1" I need to use 0,0. If I
print with margins set to 1" and the rectangle area to (0,0,
MarginBounds.With, MarginBounds.Height) then the actual printout is
perfect (nice margin of 1" on top and left side). However the Print
Preview is incorrect -> displaying the graphics in the upper most left
corner (due to the 0,0 of the rectangle).

So to solve this I need to check wether I'm in PrintPreview or I'm
actually printing it to the Printer, correct? So this is a bug or
something? And I'm not doing anything wrong?

WHat is the best way to know if I'm drawing to the actual Printer or to
the Print Preview?

Thank you,
Tinus

"Ron Allen" <rallen@_nospam_src-us.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Tinus,
I normally find the Hard Margins of the printer and then do a
TranslateTransform on the resulting graphics to get the drawing area
setup so that I can specify actual page coordinates. I check to see if
the page is being sent to the printer by checking to see if the
VisibleClipBounds.Height of the Graphics is less than the physical page
height and only then apply the transform. I've written some code to get
the HardMargins of the printer using PInvoke on GetDeviceCaps. You can
probably find it in the archives of
microsoft.public.dotnet.framework.drawing or if you can't find it I can
post it for you. Assuming you have the code to get hard margins the
following works to do the transform if required.
--------------------------------------------------------------------------------------------------
// this is inside a PrintPage call -- all the stock items are setup
in OnBeginPrint
IntPtr hDc = ev.Graphics.GetHdc();
ev.Graphics.ReleaseHdc(hDc);
float left = 0.0f, right = 0.0f, top = 0.0f, bottom = 0.0f;
PrintUtils.GetHardMargins(hDc.ToInt32(), ref left, ref top, ref right,
ref bottom);
if (ev.Graphics.VisibleClipBounds.Height < 1100.0f)
{
ev.Graphics.TranslateTransform(-left, -top);
}
else
{
m_color = true; // printing to screen
ev.Graphics.TextRenderingHint =
System.Drawing.Text.TextRenderingHint.AntiAliasGri dFit;
}
--------------------------------------------------------------------------------------------------
Note that in FW 2.0 you can get this information using properties of the
Graphics including if the printing is being done to a PrintPreview
without all these calls.
Let me know if you need the GetHardMargins code.
Ron Allen

------------------snip-------------------------------

Nov 17 '05 #8
Tinus,

I faced the same situation like you have here.
I have posted a work around that worked for me.

do a search "How to print in full page without margins". Go to the last
message posted by me. I just posted it so it would take at least 5 minutes to
show up there.

Thanks,
Judge

"Tinus" wrote:
So, please let me explain in more detail what is hapening....

Page Setup: all Margins set to 1"
The e.MarginBounds.Left = 100 pixels
The e.MarginBounds.Top = 100 pixels

If I now print a Rectangle using(e.MarginBounds.Left, ...Top, ...Width,
....Height) then the actual printed margin is +/- 1.8" (so almost double the
size set using the Page Setup dialog).

Using Rons GetDeviceCaps I get a HardMarginLeft:11 pixels and Top: 13
pixels. So that can not be the problem: 0.8" is not 11 pixels;

If I however set the Margins again to 1" using the PageSetupDialog but draw
a Rectangle using (0, 0, e.MarginBounds.Width, ...Height) then the printout
is correct -> margins on the paper are 1" all around. However the Print
Preview is incorrect showing the draw rectangle in the upper left most
corner due to the (0,0) coordinate.

Hope someone knows what I'm doing wrong :-(

Thanks,
Tinus

"Ron Allen" <rallen@_nospam_src-us.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Tinus,
I normally find the Hard Margins of the printer and then do a
TranslateTransform on the resulting graphics to get the drawing area setup
so that I can specify actual page coordinates. I check to see if the page
is being sent to the printer by checking to see if the
VisibleClipBounds.Height of the Graphics is less than the physical page
height and only then apply the transform. I've written some code to get
the HardMargins of the printer using PInvoke on GetDeviceCaps. You can
probably find it in the archives of
microsoft.public.dotnet.framework.drawing or if you can't find it I can
post it for you. Assuming you have the code to get hard margins the
following works to do the transform if required.
--------------------------------------------------------------------------------------------------
// this is inside a PrintPage call -- all the stock items are setup in
OnBeginPrint
IntPtr hDc = ev.Graphics.GetHdc();
ev.Graphics.ReleaseHdc(hDc);
float left = 0.0f, right = 0.0f, top = 0.0f, bottom = 0.0f;
PrintUtils.GetHardMargins(hDc.ToInt32(), ref left, ref top, ref right,
ref bottom);
if (ev.Graphics.VisibleClipBounds.Height < 1100.0f)
{
ev.Graphics.TranslateTransform(-left, -top);
}
else
{
m_color = true; // printing to screen
ev.Graphics.TextRenderingHint =
System.Drawing.Text.TextRenderingHint.AntiAliasGri dFit;
}
--------------------------------------------------------------------------------------------------
Note that in FW 2.0 you can get this information using properties of the
Graphics including if the printing is being done to a PrintPreview without
all these calls.
Let me know if you need the GetHardMargins code.
Ron Allen
"Tinus" <no****************@xxx.karssemeijer.com.noadv.xxx > wrote in
message news:uA**************@TK2MSFTNGP15.phx.gbl...
Hello all,

Because you have been so helpfull the last couple of times, I thought
after testing and wasting more than 20 pages (and google-ling for 3 days
:-( ). I would ask you again for your help.

The problem is this:
If I print a rectangle which begins at (0,0) and the margins are also set
to 0 (l:0, t:0, r:0, b:0) then it prints fine (ok, not quite because 0,0
is inside the none printable area but I corrected for that by checking to
see if the margins are inside the non printable are and if so then
correcting for that otherwise I use the MarginBounds from the
PrintEventArgs).

Now when I set the margins (using the PageSetupDialog) to e.g.: 1" (l:1",
t:1", r:1", b:1") then it prints incorrectly. The margin on the left and
top are almost double the size I specified: 1.75". And no, the non
printable are is not 0.75", it is only 0.2".

However if I set the margins to 1" but the rectangle x,y to 0,0 then the
print out is correct. The left and top margin are exactly 1".

So, for now I also have the rectangle set to (0, 0, MarginBounds.Width,
MarginBounds.Height) and the document comes out fine but the downside of
that is that the PrintPreview is incorrect (starts always on the upper
left corner: 0,0 which is obvious).

Hopefully someone here can help me again. I have a feeling I'm
overlooking something.
BTW: In MS Word a document with margins set to 1" (or something else) are
printed perfectly and is also correctly shown in the Print Preview.
I.o.w. my printer is not broken...

Thank you in advance!

With regards,
Tinus
- The Netherlands -



Nov 17 '05 #9

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

Similar topics

4
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
5
by: Mr. B | last post by:
This is driving me NUTZ!!! I've been screwing around on this for a week now. And I have tried to find examples similar to what I have (nada). Got lots of streaming a TXT file... bah! I am...
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...
4
by: iwdu15 | last post by:
can anybody help me print from a rich text box? i tried the way they showed on the MSDN web page, but it did not work. I am using VB.net 2003...any help would be appreciated
3
by: D Witherspoon | last post by:
No matter what I do the default paper size is always either A3 or 11 by 8.5 .. Here is the code. Dim dlg As DialogResult pd.DocumentName = "Weld Image" Dim pkPaperSize As New...
7
by: tm | last post by:
I am trying to print a form using the following code, everything works fine but the margins are not acted upon. What I am I doing wrong? Private Sub CaptureScreen() Dim myGraphics As...
8
by: Frank Rizzo | last post by:
I am trying to print huge images (much bigger than target paper). I try and use e.PageSettings.HardMarginX and e.PageSettings.HardMarginY in the PrintDocument's PrintPage event to try and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.