Problems with the unprintable areas
Hi everybody!
In the program I'm working on the user can define the margins of the page.
When he chooses a small value for the bottom margin the last line of the
report is visible on the preview but not on the printed report. Now i wonder
if it is possible to use the 'GetDeviceCaps' function of the WinAPI to get
the unprintable area or if it only returns the margins that were chosen by
the user.
Maart Hoff
In the program I'm working on the user can define the margins of the page.
When he chooses a small value for the bottom margin the last line of the
report is visible on the preview but not on the printed report. Now i wonder
if it is possible to use the 'GetDeviceCaps' function of the WinAPI to get
the unprintable area or if it only returns the margins that were chosen by
the user.
Maart Hoff
This discussion has been closed.
Comments
page definition. We don't try to limit what can be set. If you use
GetDeviceCaps you can determine:
PHYSICALOFFSETX For printing devices: the distance from the left edge of
the physical page to the left edge of the printable area, in device units.
For example, a printer set to print at 600 dpi on 8.5"x11" paper, that
cannot print on the leftmost 0.25" of paper, has a horizontal physical
offset of 150 device units.
PHYSICALOFFSETY For printing devices: the distance from the top edge of the
physical page to the top edge of the printable area, in device units. For
example, a printer set to print at 600 dpi on 8.5"x11" paper, that cannot
print on the topmost 0.5" of paper, has a vertical physical offset of 300
device units.
Then you should be able to set limitations on what the user can set the
margins for their report on their selected printer. You could also loop
through all of the installed printers on their machine and then set the
minimum allowed margin to be the printer with the greatest unprintable area.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com