08 - Štampanje crteža i teksta

Načini štampanja u Delphi-ju:

Upotreba izlazne tekstualne datoteke

procedure TForm1.Stampa(Sender: TObject);
var
   PrintBuf: TextFile;
   i: integer;
begin
   assignprn(PrintBuf);
   rewrite(PrintBuf);
   for i := 0 to Memo1.Lines.Count-1 do
     writeln(PrintBuf, Memo1.Lines[i]);
   closefile(PrintBuf) ;
end;
uses printers;

Komponenta PrintDialog

Komponenta PrinterSetupDialog

procedure TForm1.NovaStampa(Sender: TObject);
var
   PrintBuf: TextFile;
   i: integer;
begin
   if PrintDialog1.Execute then begin
      assignprn(PrintBuf);
      rewrite(PrintBuf);
      for i := 0 to Memo1.Lines.Count-1 do
        writeln(PrintBuf, Memo1.Lines[i]);
      closefile(PrintBuf);
   end;
end;