procedure TForm1.Button1Click(Sender: TObject);
begin
Printer.begin
Doc;
Printer.Canvas.TextOut(100,100,'Hi there');
Printer.EndDoc;
end;
procedure TForm1.PortraitClick(Sender: TObject);
begin
Printer.Orientation := poPortrait;
end;
procedure TForm1.LandscapeClick(Sender: TObject);
begin
Printer.Orientation := poLandscape;
end;