?
Solved

Printing problem

Posted on 2016-08-12
2
Medium Priority
?
145 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 38

Accepted Solution

by:
Geert Gruwez earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
When I recently replaced my image transfer kit on my office HP color laserjet 5550dn printer, I had a slight problem.  The left bracket that holds the transfer kit got stuck in the upright locked position instead of being at a 45 degree angle facing…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Suggested Courses

777 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