|
Page areas
TPrintJob component supports the header and footer areas. To use this feature just turn on the joHeader and joFooter flags in the Options property, set the measurement units for the header and footer using the HeaderUnits and FooterUnits propertis, set the size of the header and footer using the HeaderSize and FooterSize properties and draw the header and footer contents in the OnDraw event. The follow code just fills the header, footer and page areas by the different colors.
procedure TfrmMain.psjAreasDraw(Sender: TObject; TheCanvas: TCanvas;
PageIndex: Integer; Rect: TRect; Area: TDrawArea;
Target: TDrawTarget);
begin
with TheCanvas,Font,Rect do
begin
with Brush do
case Area of
daHeader: Color:=$CCFFCC;
daPage: Color:=$CCCCFF;
daFooter: Color:=$FFCCCC;
end;
FillRect(Rect);
end;
end;
The page area (daPage) always is drawn.
|