DelphiFAQ Home Search:
General :: Programming :: Delphi :: Printing
Find a solution for issues with printing from Delphi applications.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Send a TStringList to the printer

The easiest way to print a couple of strings is using the function AssignPrn from the Printers unit.

Use the following function e.g. like this

PrintStrings(Memo1.Lines);
to print out a memo field.

uses Printers;
 
 // ..
 
 procedure PrintStrings (S: TStrings);
 var
   Prn : TextFile;
   i   : word;
 begin
   AssignPrn(Prn);
   try
     Rewrite(Prn);
     try
       for i:=0 to S.Count-1 do 
         writeln(Prn, S.Strings[i]);
     finally
       CloseFile(Prn);
     end;
   except
     on EInOutError do MessageDlg('Fehler!', mtError, [mbOk], 0);
   end;
 end;

Generated 16:01:37 on Jan 18, 2017