Quoted directly from the Delphi 5 help file example for the "Printer" function:
This example uses a button and a memo on a form. When the user clicks the button, the content of the memo is printed, with a 200-pixel border around the page. To run this example successfully, you must add the Printers unit to the uses clause of your unit.
procedure TForm1.Button1Click(Sender: TObject);
begin
with Printer do
begin
BeginDoc;
Canvas.TextRect(Rect(200,200,PageWidth-200,
PageHeight-200),200, 200, Memo1.Lines.Text);
EndDoc;
end;
end;