Ken Allen
12/30/2004 6:43:00 PM
Is there a way to determine the physical printer margins from within a
C#/.Net application? There is a lot of useful information, including the
MarginBounds in the PrintPageEventArgs (whose contents I have not been
able to alter from the standard PrintDialog, but that is another issue),
but I can find nothing that tells me the physical limit imposed by the
specific printer.
For example, I am using an HP LaserJet 2100, which seems to be unable to
print within 1/8 inch of the top, right or bottom edge of the paper,
and unable to print within just under 1/4 inch of the left margin, but I
cannot determine where this information is reported in any of the class
objects supported by .Net, which makes it difficult to make certain that
I use all of the available paper without losing information at the right
and bottom edge.
I know that I could simply impose a 1/4 inch margin of my own, but in
this case I want to be able to maximize the amount of space available
for printing, and every 1/16 inch is valuable to me! Also, these
physical margin values vary from one printer to another, which makes it
even more difficult to deal with.
-Ken