Solved

Printing problem

Posted on 2016-08-12
2
72 Views
Last Modified: 2016-08-15
Hi,

I am using the following to send the info from a memo to the printer:

procedure TMainForm.PrintStrings(Strings: TStrings);    //sends the formula to the printer from the memo
var
  Prn: TextFile;
  i: word;
begin
  AssignPrn(Prn);
  try
    Rewrite(Prn);
    try
      for i := 0 to Strings.Count - 1 do
        writeln(Prn, Strings.Strings[i]);
    finally
      CloseFile(Prn);
    end;
   except
     on EInOutError do
       MessageDlg('Error Printing text.', mtError, [mbOk], 0);
  end;
end;

Open in new window


The problem is that the columns in the print don't line up like they do on the memo. Is there a way to tell the printer to use a non-proportional font ?
0
Comment
Question by:ChLa
2 Comments
 
LVL 36

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 41754416
Set the printer font to a font like Courier new before writing
Printer.Canvas.Font.Name:='Courier New';

You'll have to left-align your text with spaces

Or use BeginDoc
Write everything like you would on a bitmap canvas
you'll have to calculate the proper proportionings
and then do EndDoc

Here is a sample of both ways:
http://oldsite.adug.org.au/PastMeetings/Presentations/DonMacraeOct96/default.htm
1
 

Author Closing Comment

by:ChLa
ID: 41756758
Thank you very much. Your answer helped me.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

How to solve seemingly unsolvable printer issues. Users sometimes run into printing issues where all the normal steps do not seem to work. Well the steps below can show users how to take one extra step beyond the normal steps needed to remove old…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now