Page 1 of 1

draw lines

Posted: Mon Mar 21, 2016 2:19 am
by krctech
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.

Posted: Mon Mar 28, 2016 12:15 pm
by Sergey Tkachenko
I am sorry for the delay.
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;