home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
print
/
print160.arj
/
PRINT160.DOC
next >
Wrap
Text File
|
1991-07-22
|
14KB
|
394 lines
PRINT160
160 Column print program
S.T.Ellis
20 July 1991
1. OVERVIEW
-----------
PRINT160 was originally written to conserve paper by squeezing
more text onto each sheet of printer paper. This is achieved by
setting the printer into a condensed subcript mode and printing
two columns of text on a page. This allows an effective paper size
of 78 characters per line, 200 lines per page for standard listing
paper, or 214 lines per page on A4. Different column widths can be
set, as well as tabs, margins, and central dividers. In addition,
a number of EPSON print formatting commands have been supported so
that the compact version of your document will look as similar as
possible to the larger one.
2. USAGE
--------
To use PRINT160 you will need an EPSON-compatible printer. Most
printers for the PC conform to the Epson control code standard to
some degree, so this should not be too much of a problem.
In its simplest form, the program is started from the command
line, with a list of files to be printed. Eg:
C> PRINT160 FILE1.DOC FILE2.DOC
This will print out FILE1.DOC and FILE2.DOC on the printer. At
the top of each page is a header showing the date and time that
printing of the file started, the filename that you supplied, and
the page number. Below this is the text of your file, separated
into two columns by a vertical bar character. Note that the text
will stretch from one edge of the paper to the other.
It is often useful, when filing listings, to punch the left hand
edge of the paper, and so a left margin may be useful. Specifying
a "-m" option on the command line gives a 6-character margin:
C> PRINT160 -m FILE1.DOC
Note that you can use a '/' character instead of the '-' sign,
which will probably be familiar. The above example could
therefore have been written:
C> PRINT160 /m FILE1.DOC
If you want a different margin, you can specify a number after
the m from 0 to 99. For a twelve character margin type:
C> PRINT160 -m12 FILE1.DOC
The margin may be up to 99 characters wide.
Tab stops are set at 8 character intervals, except for files with
an extension of .C, where the interval is 4 characters, and .S
files which have a 12 character tab. You can override this
default using the -t option, which works in much the same way as
the -m option above. For example
C> PRINT160 -t8 FILE1.C
Will print FILE1.C with 8 character tabs. If you do not specify a
number after the -t option, 8 character tabs are assumed. So the
above example could also have been written:
C> PRINT160 -t FILE1.C
Tab widths may be up to 16 characters.
You can combine several options together by just typing them all
after the initial minus sign. So for a twelve character tab and a
margin of 10 characters,
C> PRINT160 -t12m10 FILE1.DOC
or
C> PRINT160 -t12 -m10 FILE1.DOC
You can supply different options for each file, simply by
preceding each filename by the options it requires. Any options
not resepecified since the previous file will stay the same. So,
C> PRINT160 -t12m10 FILE1.DOC -m FILE2.DOC -t FILE3.DOC
Will print FILE1.DOC with 12 character tabs and a 10 character
margin, followed by FILE2.DOC with a six character margin, still
with the 12 character tabs from FILE1.DOC. Finally, FILE3.DOC is
printed with the 6 character margin from before and 8 character
tabs.
You can specify the column width using the -w command. This can
be up to 78 characters across with no margin, reducing
proportionately according to the margin. To print a narrow file
with a column width of 65 and a margin of 20, use
C> PRINT160 -m20w65 FILE1.DOC
If you specify the width before the margin, the margin setting
will be subtracted from the total width of the columns. So, for
example (again)
C> PRINT160 -w78m6 FILE1.DOC
Will actually give a column width of 75 each, since the 6
characters from the margin have been subtracted from the total
column width.
The vertical bar down the centre of the page can be switched off
by using the -v option. This is useful for documentation where
you can be sure of a reasonable gap down the centre of the page.
Alternatively, you can specify a central gap of up to 16
characters, which will have a vertical bar down the middle unless
it has been turned off with -v. For example
C> PRINT160 -w40g7v FILE1.DOC
Will print two forty character wide columns separated by a gap of
seven characters, with no central vertical bar.
All of this so far assumes letter size ( 11 inch ) paper. To
switch to A4, use the -a option. To change back to letter again,
use -l. The default is -l.
Finally, if you wish to redirect the output to the screen ( not
very useful ) or to a file, you can use the -p option. This must
be followed immediately by a filename, PRN: or CON: for direction
to a file, the printer, or the console ( screen ). It must be the
first thing on the command line after PRINT160, and must not be
placed together with any other options. In these three examples,
the first one is correct, the second two are not:
C> PRINT160 -pPRFILE.OUT -w40g7v FILE1.DOC
C> PRINT160 -w40g7v -pPRFILE.OUT FILE1.DOC <<<<WRONG
C> PRINT160 -pPRFILE.OUTw40g7v FILE1.DOC <<<<WRONG
In the first wrong case, the options will be sent to the default
printer device before output is redirected. In the second, the
program will attempt to open a file called "PRFILE.OUTW40G7V"
which will most likely fail.
The rationale behind this is so that you can dump off a file that
you can then print in the background using PRINT ( the standard
MS-DOS print spooler ), or you can distribute documentation in
printer-ready form, so that everyone else can print it out in
160-column mode.
When printing documents containing formatting codes ( see below ),
it is useful for the program to know the default font code. This
can safely be omitted, but printing will slow down considerably.
If you know it, it can be specified with the -f option:
C> PRINT160 -f2 FILE1.DOC
This will stop PRINT160 putting default font changes on each line.
Don't worry if you can't remember all of these - typing PRINT160
by itself will bring up a helpful message with a quick reminder
of what each option does.
Lastly, if you use a specific set of options a lot, you will not
want to type them every time you print out a file. They can be
placed in an environment variable called P160OPTS. For example, if
the default page layout was -w40g7v ( column width 40, gap 7,
vertical centre line off ), then the command
C> SET P160OPTS=-w40g7v
Would make this the default. The next time you run PRINT160, it
will act as if you typed -w40g7v as the first option on the
command line.
Don't worry if you can't remember all of these - typing PRINT160
by itself will bring up a helpful message with a quick reminder
of what each option does.
3. ERRORS
---------
There are several situations that PRINT160 will recognise as
errors. You will then get one of the following messages:
ERROR: Margin too wide
The margin specified was over 99 characters wide. Specify
a narrower margin.
ERROR: Tabs too wide
The tab spacing specified was greater than 16. Use
narrower tabs.
ERROR: Tabs too narrow
The tab spacing specified was less than 2. Use wider
tabs.
ERROR: Gap too wide
The central gap is wider than 16 characters. Use a
narrower gap.
ERROR: Columns too wide to fit
The column width specified is too big to fit in the paper
with the current margin and gap. Reduce any of these.
ERROR: Only one alternative printer output allowed
The printer output has already been redirected to an
alternative file. It cannot be redirected again.
ERROR: '<letter>' is an invalid option
The letter displayed is not one of the allowed option
letters (aglmptv or w). Correct the option string.
ERROR: Cannot open <filename> for output
The alternative printer output cannot be opened for some
reason. Check that it is a valid filename.
ERROR: Cannot open file <filename>
The file <filename>, which is to be printed out, cannot
be opened. Check that it exists.
ERROR: Invalid option string
Should never happen. If it does, tell me !
4. ESCAPE CODE SUMMARY
----------------------
For those of you "in the know", the print formatting codes that
PRINT160 understands are given below, together with what action is
taken with them. They are a subset of the standard Epson ESC/P
format code standard, and should work with any printer which
claims to be Epson compatible.
Code Action Action with PRINT160
ESC @ Reset printer Resets PRINT160's flags
ESC s Half speed mode Passed through to printer
ESC < Home print head Print position homed
ESC U Unidirectional print Passed through to printer
ESC > Set bit 8 of data Passed through to printer
ESC = Clear bit 8 of data Passed through to printer
ESC # Cancel bit 8 control Passed through to printer
DC3 Deselect printer Ignored
DC1 Select printer Ignored
ESC EM Sheet feeder control Passed through to printer
CR Carriage return Print position homed
BEL Sound beeper Ignored
BS Backspace Passed through to printer
DEL Delete character Last character deleted
CAN Cancel line Home print position
LF Line feed Go to start of next line
ESC J Line feed Go to start of next line
ESC 0 Set line spacing Ignored
ESC 2 Set line spacing Ignored
ESC 3 Set line spacing Ignored
ESC A Set line spacing Ignored
FF Form feed Go to start of next column
ESC C Set page length Ignored
ESC N Set bottom margin Ignored
ESC O Cancel bottom margin Ignored
ESC B Set vertical tabs Ignored
ESC e Set vertical tabs Ignored
ESC b Set vertical tabs Ignored
ESC / Set tab channel Ignored
VT Vertical tab Go to start of next line
ESC f Set print position Go to print position
ESC Q Set right margin Ignored
ESC l Set left margin Ignored
ESC D Set horizontal tabs Ignored
ESC e Set tab spacing Tab spacing set
HT Tab Tab to next tab stop
ESC SP Set character space Ignored
ESC $ Set dot position Passed through to printer
ESC \ Set relative position Passed through to printer
ESC a Set justification Ignored
ESC x Set print mode Passed through to printer
ESC k Set font Passed through to printer
ESC ! Style select Passed through to printer
ESC M Select 12-pitch chars Ignored
ESC P Select 10-pitch chars Ignored
ESC g Select 15-pitch chars Ignored
ESC p Set proportional Passed through to printer
SI Set condensed Ignored
ESC SI Set condensed Ignored
DC2 Cancel condensed Ignored
SO Set wide Passed through to printer
ESC SO Set wide Passed through to printer
DC4 Cancel wide Passed through to printer
ESC W Set/cancel wide Passed through to printer
ESC w Set/cancel dbl height Cancel/set subscript
ESC E Set emphasized Passed through to printer
ESC F Cancel emphasized Passed through to printer
ESC G Set double strike Passed through to printer
ESC H Cancel double strike Passed through to printer
ESC S Set super/subscript Ignored
ESC T Cancel super/subscript Ignored
ESC - Set/cancel underline Passed through to printer
ESC R Select character set Passed through to printer
ESC 4 Select italics Passed through to printer
ESC 5 Cancel italics Passed through to printer
ESC 6 Expand print area Passed through to printer
ESC 7 Contract print area Passed through to printer
ESC & Define characters **NOT SUPPORTED**
ESC : Copy default char set Passed through to printer
ESC % Set user char set Passed through to printer
ESC x Set LQ/draft print Passed through to printer
ESC * Bit image printing **NOT SUPPORTED**
ESC K Bit image printing **NOT SUPPORTED**
ESC L Bit image printing **NOT SUPPORTED**
ESC Y Bit image printing **NOT SUPPORTED**
ESC Z Bit image printing **NOT SUPPORTED**
ESC ? Bit image printing **NOT SUPPORTED**
The codes marked "NOT SUPPORTED" are not processed by PRINT160 and
should thus not be used. If you do, the results will certainly be
unpredictable.
5. CREDITS
----------
PRINT160 was written entirely in TURBO-C from Borland. It was
then compressed for release by PKZIP v1.02, from PKWARE. This is
a very handy program also available through the public domain,
and so is well worth the plug.
6. SOFTWARE LICENSE
-------------------
It's the legal bit !
PRINT160 is Copyright Sean T Ellis 1991.
You are free to use, copy and distribute PRINT160 for
NONCOMMERCIAL use if:
No fee is charged for use, copying or distribution.
It is not modified in any way.
Clubs and user groups may charge a nominal fee not to exceed
£3.50 for expenses and handling while distributing PRINT160.
Commercial software licences are available for a flat fee of £50
from the address below.
Sean T Ellis ("The author") hereby disclaims all warranties
relating to this software, whether express or implied, including
without limitation any implied warranties of merchantability or
fitness for a particular purpose. The Author will not be liable
for any special, incidental, consequential, indirect or similar
damages due to loss of data or any other reason, even if The
Author or an agent of The Author has been advised of the
possibility of such damages. In no event shall The Author's
liability for any damages ever exceed the price paid for the
license to use software, regardless of the form of the claim.
The person using the software bears all risk as to the quality
and performance of the software.
7. WATCH THIS SPACE
-------------------
Since PRINT160 is continually being updated as I use it more and
more, there will probably be future releases on an irregular
basis. Keep your eyes peeled ! Any comments or suggestions that
you send may appear in later versions.
You can get in contact with me via the following address:
Sean Ellis
39 Connaught Road
Reading
Berkshire RG3 2UD
ENGLAND
Sean