
The ECN No Name Newsletter is no longer being published. This is an archived issue.
[next article]Stacey Clark
Do you want to list plain files on a laser printer?
Have your output in 2 columns?? Sideways?
Print out instructions in nice fonts?
The enscript command can be used to list text in each of these ways. If you print out a file to the laser printer xxx using the basic:
lpr -Pxxx filename
you will get a constant width font. Occasionally you may wish to print very wide printouts. Using a smaller font and printing "sideways" (landscape mode) would allow you to fit 80 or 120 characters on a line without any line wrapping. Enscript converts text files to PostScript format for printing on a PostScript printer. If you type "man enscript" you can read about some of the options available when using this command.
Below is a list of useful options.
-2 two column mode
-r rotate output 908o9 (landscape mode)
-G print a gaudy header
-ffont use specified font
-h suppress printing of title page
-Pxxx send output to the specified printer
You can use these options in any combination, but you must also specify the filename. If no -P option is specified, lpr will use the printer set by the environment variable "PRINTER". For those people using C-shell, setenv PRINTER printername should be added to their .login file. The example at the bottom of this page shows how the gaudy header prints the page headings, date, and page number.
To achieve portrait orientation (normal 8 1/2" x 11" placement) with default Courier font in point size 10, type:
enscript -Pxxx filename
To achieve landscape orientation (sideways on standard paper) with output in two columns, using the default font (Courier, point size 7), type:
enscript -2r -Pxxx filename
You can specify the font to use with -ffontname where fontname is
one of the available fonts. To list the fonts that are available,
type ls /usr/lib/ps/*.afm" .
AvantGarde-Book.afm
AvantGarde-BookOblique.afm
.
.
Garamond-Bold.afm
Garamond-BoldItalic.afm
.
.
Palatino-Bold.afm
Palatino-BoldItalic.afm
Palatino-Italic.afm
Palatino-Roman.afm
etc.
Type the font name exactly as listed, omitting the .afm extension. Append the desired point size (6, 8, 10, 12, . . .) to the abbreviated font name. The bigger the point size, the bigger the letters. An example would be:
enscript -r2Gh -fOptima12 -Pci2 filename
In this case the printout would be in two-column landscape mode with a gaudy header in point size 12 and the Optima font.
You can set the default font, size, etc. in your .login file by defining the environment variable ENSCRIPT. For example:
setenv ENSCRIPT '-Gh -Pxxx -fHelvetica12'
Remember for more information, type "man enscript" .