This printer (TVS MSP 250 Star) supports ESC/P (this is an Epson standard) and IBM Proprinter emulation. This means you can send a small file before your actual file which switches the printer to condensed mode.
For the ESC/P emulation you can do the following:
Make a small.txt
file:
<#27><#15>
This is not a literal file. The file should be just 2 character (#27 and #15). You'll need an editor who can create an "Escape" (#27) and "Condensed" (#15) character (e.g. Hex-editor). If you don't have one see below how to make the file.
Next you can print your file like this:
copy small.txt+ACTUAL_FILE.TXT LPT1
exit
If you don't have a Hex-editor you can do the following:
Make a textfile with the following (call it small.vbs
):
Wscript.Stdout.Write Chr(27)+Chr(15)
Then execute the following on a command prompt:
cscript /nologo small.vbs > small.txt
This will result in a small.txt
file which you can use with the copy command.
Edit: It is recommended to try #15
only first. If that does not work try #27#15
.
To write #15
in C# you could use (char)15
or \x0F
.
From the ESC/P manual:
and
Edit:
To summarize (excluding the borders/margins, so it could be less with margins):
- 10cpi ≈ 58 characters = Esc P (
#27P
)
- 12cpi ≈ 70 characters = Esc M (
#27M
)
- 15cpi ≈ 87 characters = Esc g (
#27g
)
- 10cpi condensed ≈ 100 characters = Esc P SI (
#27P#15
)
- 12cpi condensed ≈ 116 characters = Esc M SI (
#27M#15
)
- 15cpi condensed ≈ (not available)
So the smallest would be #27M#15
. (116 characters)
If you don't need the file to be opened in a normal editor you can include these codes in your file. You can then also add goodies like bold, italic etc. To set a word in bold you could do the following:
This is a #27Ebold#27F word.
#27E
sets bold and #27F
cancels it again. You could also switch back to 10cpi and combine it with bold.
#27M#15This is a #18#27P#27Ebold#27F#27M#15 word.
#27M#15
to set it to 12cpi condensed. #18
to cancel condensed. #27P
to set 10cpi and after the word #27M#15
to set it to 12cpi condensed again.
You could also use the "Double font width/height":
#27M#15This is a #27W#1#27w#1big#27W#0#27w#0 word.
#27W#1
Double font width and #27w#1
Double font height and #0
to cancel them again.
You see that you can combine all of these codes to do anything. There is also a "Master Select" (page 125 of the manual). If you switch a lot between fonts you can use that to switch cpi, bold, condensed, italic etc in one command. (#27!
+n where n is the type)
1Is it actually MS-DOS? Or the Windows CMD prompt? – Alan B – 2013-10-21T09:24:38.897
its CMD Prompt in Windows 7 – Suresh – 2013-10-21T09:27:08.553
What's the make and model of the printer? – Rik – 2013-10-21T10:24:20.967
TVS MSP 250 Star Dot Matrix Printer – Suresh – 2013-10-21T10:26:29.713