Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Printing problem

Posted on 2016-08-12
2
Medium Priority
?
153 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

636 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