trichview.support
Re: FooterYMM and BottomMarginMM |
Author |
Message |
Stefan M. Huber |
Posted: 10/12/2004 16:15:08 On Tue, 12 Oct 2004 16:44:20 +0400, Sergey Tkachenko <svt@trichview.com> wrote: > Did you ever tried to set very small (probably zero) page margins in MS > Word? > MS Word says something like "One ore more margins are outside printing > area" and sets them to the minimal acceptable values. I plan the same > feature in RichViewActions later. Not MSWord, but similar products :) > I'll try to explain how to get the printing area. > This explanation is related mostly to WinAPI, not to TRichView. > You can get printer device context by the function RV_GetPrinterDC (from > PtbrRV.pas), query some values by GetDeviceCaps, then free this device > context by DeleteDC. Hm, I'll try to investigate into this direction. > Look at the attached picture. Gray area - area where the printer cannot > print, white area in the middle is a printable area. Printer can print > only > inside this white area (and print preview shows only this white area), > but > all margins and FooterYMM and HeaderYMM are calculated from the real page > edges. OK, that helps a lot. Maybe you should rephrase the section in the help file, right where FooterYMM andHeaderYMM are discussed. It was not clear until you mentioned it, that the printable area is not respected (yet) and that one has to care for it oneself. > If some margin is less than the corresponding gray area, part of content > goes beyond the printable area and is not printed. > The corresponding parameters of GetDeviceCaps are specified on the image. > They are returned in pixels. > In order to convert them to mm, use the following formula: > size_mm = (size_pixels*127)/(5*logpixels), where > logpixels is > for vertical sizes: value returned by GetDeviceCaps for LOGPIXELSY. > for horizontal sizes: value returned by GetDeviceCaps for LOGPIXELSX. I'll now try to incorporate your information into my preview/print handler and check the results. I'll let you know about any results. You're a real kind person, Sergey! I am truly overwhelmed. Thanks, Stefan |
Powered by ABC Amber Outlook Express Converter