draw lines
draw lines
I want to be able to draw a border around the page at the margins. Simply a 1-pixel, solid black border. It's not obvious to me how this done. My document is simply a 1 page report (possible 2 page) but the customer wants this feature.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I am sorry for the delay.
If you use TRVPrint for printing, use OnPagePostPaint event:
If you use TRVPrint for printing, use OnPagePostPaint event:
Code: Select all
procedure TForm1.RVPrint1PagePostpaint(Sender: TRVPrint; PageNo: Integer;
Canvas: TCanvas; Preview: Boolean; PageRect, PrintAreaRect: TRect);
begin
Canvas.Pen.Color := clBlack;
Canvas.Pen.Width := Canvas.Font.PixelsPerInch div 96;
Canvas.Pen.Style := psInsideFrame;
Canvas.Brush.Style := bsClear;
with PrintAreaRect do
Canvas.Rectangle(Left, Top, Right, Bottom);
end;