When I'm printing, I need to know the page height in mm (or inch). There's the
function TPrinter.GetPrinter, where I can receive a DEVINFO structure.
Does anybody know how to use this function and waht I must pass for the first
three arguments? Or is there another way to get the PageHeight?
Joey
In article <53tk5s$j...@news01.uni-trier.de>, mar...@explorer.uni-trier.de
Try using
dpi := GetDeviceCaps(Printer.Canvas.Handle,LOGPIXELSY);
to get the number of pixels per inch. If you want the pageheight in mm you
have to use
pageheight := Printer.PageHeight / dpi * 25.4;
The same should work with Printer.Canvas.Height.
Michael
>In article <53tk5s$j...@news01.uni-trier.de>, mar...@explorer.uni-trier.de
>(Joachim Marder) writes:
>>Hi!
>>
>>When I'm printing, I need to know the page height in mm (or inch). There's
>>the
>>function TPrinter.GetPrinter, where I can receive a DEVINFO structure.
>>Does anybody know how to use this function and waht I must pass for the
>>first
>>three arguments? Or is there another way to get the PageHeight?
>>
>>
>> Joey
>>
>Try using
>dpi := GetDeviceCaps(Printer.Canvas.Handle,LOGPIXELSY);
>to get the number of pixels per inch. If you want the pageheight in mm you
>have to use
>pageheight := Printer.PageHeight / dpi * 25.4;
>The same should work with Printer.Canvas.Height.
> Michael
Or try
pageheight := GetDeviceCaps(Printer.Canvas.Handle,VERTSIZE);
to get the height in millimeters directly.
David