trichview.com

trichview.support




Re: FooterYMM and BottomMarginMM


Return to index


Author

Message

Sergey Tkachenko

Posted: 10/12/2004 15:44:20


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.


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.


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.

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.




> OK, so I'd have to get the printing area first? I thought GetFooterRect is

> doing this job for me. Do you have any pointers as to how to get the

> printing area?



begin 666 page.gif

M1TE&.#EA0P+T`;,``````( ```" `(" ````@( `@ " @(" @,# P/\```#_

M`/__````__\`_P#______RP`````0P+T`0`$_O#)2:N]..O-N_\9`8YD:9YH

MJJYLZ[YP+,]T;<OBK>]\[__ H'!(+))RQJ1RR6PZG]!H#"FM6J_8K':[I7*_

MX+!X3"Y+O.:T>LUNNTWHMWQ.K]NC\;M^S^_[450$@H$3.5Y(@Q2!@A:'%X.+

MC&>)A9*3E ^0B(5_G9Z?:81GG*.EF:2GIIN<HHJNIJBHJX^-J:"WN+E2K;.$

MK:^V%2*_L+.QL,? RKK,S<X_D=&.PI:V<;VULM68EXJ0PK3/XN/D,,2JX!C8

MC=_(P<;NP'G!H_/E]_CYZ?'PT]:R`-WQRB8OV3%X^A(J)'?NW[),V[SUNV2I

MG<!'VRP6V[>PH\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