Es gibt nen printersetupdialog
und nen printdialog
Delphi-Quellcode:
procedure TForm1.button1Click(Sender: TObject);
begin
PrinterSetupDialog1.Execute;
end;
procedure TForm1.button2clik(Sender: TObject);
var
n, m, maxText: word;
begin
if PrintDialog1.Execute then
begin
Printer.Title:= FFileName;
Printer.BeginDoc;
{beginn der Druckanweisung}
m:=0;
n:=0;
Printer.NewPage;
while m<Memo1.Lines.Count do
begin
Printer.Canvas.TextOut(50,50+n,Memo1.Lines[m]);
maxText:= Printer.Canvas.TextHeight(Memo1.Lines[m]);
Inc(n,maxText);
if n>= Printer.PageHeight-100 Then
begin
Printer.NewPage;
n:=0;
end;
inc(m);
end;
{ende der Druckanweisung}
Printer.EndDoc;
end;
end;