Print Margins

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.
 
H

Herfried K. Wagner [MVP]

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>
 
G

Guest

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?
 

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