Print Margins

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I use the PageSetUpDialog to set the margins on my HP Laser Jet 4 printer. I
set both margins to 1 with a paper size of 8.5 x 11 (Letter). When printing,
print starts as it should on the left margin but the right margin is 1/2 inch
off, i.e., 1/2 inch from the right side of the paper instead of 1 inch). Has
anyone else had this problem and if so, is there a reason it does this?

In code, the graphics in the PrintPage event has the correct marginbound
setting of 1 inch and the graphic size is correct as well.
 
Dennis said:
I use the PageSetUpDialog to set the margins on my HP Laser Jet 4 printer.
I
set both margins to 1 with a paper size of 8.5 x 11 (Letter). When
printing,
print starts as it should on the left margin but the right margin is 1/2
inch
off, i.e., 1/2 inch from the right side of the paper instead of 1 inch).
Has
anyone else had this problem and if so, is there a reason it does this?

I am curious what the code below returns for your printer:

Determining a printer's physical margins
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=getphysicalprintermargins&lang=en>
 
I tried you code and got the following error:

An unhandled exception of type 'System.InvalidOperationException' occurred
in system.drawing.dll

Additional information: The object is currently in use elsewhere.

on the line in "GetPhysicalMargins" on the line:
With m
.Left = CInt(ox * 100 / Graphics.DpiX) 'ERROR on thie LINE

Any idea what is wrong?
 
Back
Top