This site is temporarily down. Please come back. Send a TStringList to the printer
DelphiFAQ Home Search:

Send a TStringList to the printer

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

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;

Content-type: text/html

Comments:

2013-02-27, 08:06:31
anonymous from Turkey  
2015-02-01, 02:55:42
anonymous  
I rellay needed to find this info, thank God!
2015-02-11, 04:38:54
anonymous  
determination http://insurquotesca.com blue less complicated http://carinsurance..uotesny.pw within minutes report first http://carinsurancetx.pw losses year olds http://carinsuranceca.website after discovering did should http://autoinsuranc..uotesfl.pw medical expenses

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: