Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Problems with the unprintable areas

edited September 2002 in General
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

Comments

  • edited September 2002
    RB copies the settings of the margins that are set on the printer setup's
    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

This discussion has been closed.