uses Printers;
procedure TForm1.Button1Click(Sender: TObject);
var
tm: TTextMetric;
i: integer;
begin
if PrintDialog1.Execute then
begin
Printer.BeginDoc;
Printer.Canvas.Font.Handle := GetStockObject(DEVICE_DEFAULT_FONT);
GetTextMetrics(Printer.Canvas.Handle, tm);
for i := 1 to 10 do
Printer.Canvas.TextOut(100,i * tm.tmHeight + tm.tmExternalLeading,'Test');
Printer.EndDoc;
end;
end;
|