Google Answers Logo
View Question
 
Q: dot matrix printer control codes ( No Answer,   2 Comments )
Question  
Subject: dot matrix printer control codes
Category: Computers > Programming
Asked by: darrelp-ga
List Price: $25.00
Posted: 16 Sep 2002 23:02 PDT
Expires: 16 Oct 2002 23:02 PDT
Question ID: 65856
I need to send printer control codes to 9 pin dot matrix printers that
increase the size of the characters up to a font size equal to 36 in
microsoft word. I believe most of the printers being used with my
programs can accept both IBM and EPSON printer instructions. it is my
intent to allow the user to enter a number and for my program to send
the equivalent font size code to the printer. My program will have the
provision to send the font code and the "back to normal" code as user
entered on a printer set up screen.

Request for Question Clarification by joseleon-ga on 16 Sep 2002 23:37 PDT
Hello:
  Are you printing in Windows or in DOS mode?

Regards.

Clarification of Question by darrelp-ga on 17 Sep 2002 08:11 PDT
Through a database called Versaform which is dos based The database
lets me send printer control codes. I would like to give the end user
the ability to simply choose the size of print to use on various
labels but to date have only been able to turn on and off condensed
print which is the opposite direction needed.
Answer  
There is no answer at this time.

Comments  
Subject: Re: dot matrix printer control codes
From: tealcrow7-ga on 17 Sep 2002 00:15 PDT
 
Keep in mind that Dot Matrix ROM chip fonts don't work like the
"installable" softfonts, nor like Windows .fon or .ttf font files. 
However...

after digging through some of my "old skool" stuff, I found this EPSON
mode example thats in BASIC.

2 REM CONTROL COMMAND: ESC !n
5 REM OPEN PRINTER DEVICE
10 OPEN "LPT1:" FOR OUTPUT AS #1
15 REM DEFINE CONTROL CODES: SO, ESCAPE, AND LINEFEED
20 SO$=CHR$(14):ESC$=CHR$(27):LF$=CHR$(10)
2610 PRINT #1,SO$;"ESC ! n"
2630 FOR J=0 TO 7
2640 I=2^7
2650 IF I=1 THEN I=0:REM OFFSET 1
2660 IF I=2 THEN I=1:REM JUMP UNNECESSARY MODES
2670 PRINT #1,ESC$;"!";CHR$(I);"PRINTING MODE ";I:NEXT J
2680 PRINT #1,ESC$;"!";CHR$(O);LF$;LF$

The output from this program is as follows (as close as I can
represent it):

ESC ! n      (about fontsize 30)
PRINTING MODE 0      (NORMAL DOTMATRIX SIZE = 10)
PRINTING MODE 1      (SMALLER THAN NORMAL, ABOUT FONTSIZE 7 OR 8)
PRINTING MODE 4      (ABOUT FONTSIZE 5 OR 6)
PRINTING MODE 8      (SLIGHTY SMALLER THAN NORMAL = 8)
PRINTING MODE 16     (FONT SIZE 8, BOLD)
PRINTING MODE 32     (VERY LARGE, 32 POINT FONT)
PRINTING MODE 64     (ITALICS, ABOUT FONTSIZE 8)
PRINTING MODE 128    (UNDERLINE, FONTSIZE 8)

So, You can readily tell that directly talking to the printer in
control codes is not a way that will provide you with a reliable way
of producing a consistant font size(this is also determined by
manufacturer implementations in DIFFERENT VERSIONS of the ROM chips).

So, The best thing you can do (since you said you are doing this from
MS Word, then you're using windows), is to...

Go to Start/Settings/Printers.
Add a Local Printer
Set the printer up with the "Epson Compatible 9 Pin" driver, the IBM
"Generic IBM Graphics 9 Pin" driver, or a simple "HP Deskjet" driver
(the HP driver won't interfer with any output you send to the
printer... we do that at my place of work all the time).

If none of those work, then as a last resort, try the "Mannesmann
Tally MT 150/9".  I have a cranky epson with dual IBM and EPSON
emulation that got confused on lost of things, but the Mannesmann
Tally driver was able to keep it straight.

After the driver is installed, then besure to print a test page. If
you see the 9 pin printer accurately create the Windows Logo on the
paper... then it will work with anything you decide to do with MS Word
(then you can use reliable truetype fonts, and the printer won't care
at all, it will only see all of the data as an image in memory that's
called a Windows Metafile, or DIB).

Do a search on google for Metafile, DIB, and/or Dot Matrix
Compatibility.

As far as your program is concerned, you can use a little VBA (Visual
Basic for Applications) programming to store and modify the Font size
used for any text report.  Search google for the Microsoft MSDN site,
and then search for VBA and/or MS Word Document Object Model.

Good Luck!
Subject: Re: dot matrix printer control codes
From: darrelp-ga on 17 Sep 2002 09:02 PDT
 
thank you for the info. the program is actually running on all
versions of windows and some unix/xenix machines in a dos window. I'll
play with your suggestions. you've given me several routes to explore.
Money well spent.
darrel

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy