Delphi/CB
•  Greatis •  Security •  AppDatabase •  Utilities •  Visual Basic • .NET •  just4fun
Delphi / C++ Builder
Components, utilities and tips for Delphi and C++ Builder developers
More info
Print Suite FAQ
Print Suite Home
Delphi Components
See also
Products
Form Designer
Object Inspector
Runtime Fusion
Commented Image
Image Editor  new!
Delphi Toys
Ultimate Pack  hot!

FAQs
Form Designer FAQ
Object Inspector FAQ
Image Editor FAQ

Links
Software for .NET
Software for VB 6
Delphi Tips & Tricks

Services
Outsourcing
Areas coordinates
TPrintJob passes the coordinates of each print area (header, footer and page area) into the OnDraw event by the TheRect parameter. The coordinates always in pixels and by default point the real area coordinates in the page, so the left and top corner can be offset from the (0,0) point , but TPrintJob component has the RelativeCoords property that allow to emulate the drawing from the (0,0) point. If this property is True, the drawing areas always starts from the (0,0) point, but the code that use the left top point coordinates will work properly independently from the RelativeCoords property. The following code will out the text at the left top corner of the page area properly only in the RelativeCoords property is True.
procedure TfrmMain.psjAreasDraw(Sender: TObject; TheCanvas: TCanvas;
  PageIndex: Integer; Rect: TRect; Area: TDrawArea;
  Target: TDrawTarget);
begin
  with TheCanvas do
    if Area=daPage then
      TextOut(0,0,'Some text here...');
end;
The code below will always work properly.
procedure TForm1.PrintJob1Draw(Sender: TObject; TheCanvas: TCanvas;
  PageIndex: Integer; TheRect: TRect; Area: TDrawArea;
  Target: TDrawTarget);
begin
  with TheCanvas,TheRect do
    if Area=daPage then
      TextOut(Left,Top,'Some text here...');
end;

Greatis Software Greatis | Security | AppDatabase | Utilities | Delphi/CB | Visual Basic | .NET | just4fun

Contacts | Add to Favorites | Recommend to a Friend | Privacy Policy | Copyright © 1998-2008 Greatis Software