[Lazarus] Printer margins

Jesus Reyes jesusrmx at yahoo.com.mx
Sun Jun 22 00:17:50 CEST 2008




--- El sáb 21-jun-08, Felipe Monteiro de Carvalho <felipemonteiro.carvalho at gmail.com> escribió:

> De:: Felipe Monteiro de Carvalho <felipemonteiro.carvalho at gmail.com>
> Asunto: Re: [Lazarus] Printer margins
> A: "General mailing list" <lazarus at lazarus.freepascal.org>
> Fecha: sábado, 21 junio, 2008, 4:14 pm
> ping about this e-mail:
> 
> thanks
> 
> On Sat, Jun 14, 2008 at 12:32 PM, Felipe Monteiro de
> Carvalho
> <felipemonteiro.carvalho at gmail.com> wrote:
> > On Tue, Jun 10, 2008 at 9:09 PM, Jesus Reyes
> <jesusrmx at yahoo.com.mx> wrote:
> >>> If WorkAre is the Physical limits, then what
> is
> >>> Printer.PaperSize.PaperRect.PhysicalRect ?
> >>
> >> That would be page width and height encoded in a
> TRect
> >
> > I don't understand. What is the difference between
> WorkRect and PhysicalRect?
> >
> > If you use WorkRect to know what Canvas area is
> drawable, what do you
> > use PhysicalRect for?
> >


my appologize I though I already replied. 

Maybe I created some confusion about physical limits, sorry. I didn't now how to express (apart from printable area) how to describe the area is physically printable by the printer (supposedly), now windows GetDeviceCaps give two terms PHYSICALWIDTH and PHYSICALHEIGHT, they are plainly the physical dimmensions of page. 

that is, Printer.PaperSize.PaperRect.PhysicalRect is Page Widht and Height encoded in a rect or if you like code (winprinters.inc:605)

      with aPaperRC.PhysicalRect do begin
        Left  :=0;
        Top   :=0;
        Right :=Windows.GetDeviceCaps(fDC, PHYSICALWIDTH);
        Bottom:=Windows.GetDeviceCaps(fDC, PHYSICALHEIGHT);
      end;

Then we have also Printer.PaperSize.PaperRect.WorkRect that is the printable area which is always smaller or equal to PhysicalRect, I call this physical limits because supossedly out of this limits the printer can't print. In code, see winprinters.inc also:

      with aPaperRC.WorkRect do begin
        Left  :=Windows.GetDeviceCaps(fDC, PHYSICALOFFSETX);
        Top   :=Windows.GetDeviceCaps(fDC, PHYSICALOFFSETY);
        Right :=Left   + Windows.GetDeviceCaps(fDC, HORZRES);
        Bottom:=Top    + Windows.GetDeviceCaps(fDC, VERTRES);
      end;

I initially treated Printer.PaperSize.PaperRect.WorkRect as "the margins" which is not completly true as I wrote in my previous msg.

Jesus Reyes A.


      ____________________________________________________________________________________
Yahoo! Deportes Beta
¡No te pierdas lo último sobre el torneo clausura 2008! Entérate aquí http://deportes.yahoo.com




More information about the Lazarus mailing list