[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 2


enscript Command

Purpose

Converts text files to PostScript format for printing.

Syntax

enscript [ -1 -2 -c -g -k -l -m -o -q -r -B -G -K -R ] [ -b Header ] [ -f Font ] [ -f0 CodeSet:Font ] [ -f1 CodeSet:Font ] [ -p Out ] [ -F Hfont ] [ -F0 CodeSet:Font ] [ -F1 CodeSet:Font ] [ -L Lines ] [ -M MediaName ] [ -X CodesetName ] [ SpoolerOptions ] [ File ... ]

Description

The enscript command reads a text file, converts it to PostScript format, and spools the file for printing on a PostScript printer. You can use this command to specify fonts, headings, limited formatting options, and spooling options.

For example:

enscript -daleph bubble.txt

prints a copy of the bubble.txt file on the printer called aleph, and

enscript -2r finder.c

prints a two-up landscape listing of the finder.c file on the default printer.

The ENSCRIPT environment variable can be used to specify defaults. The value of ENSCRIPT is parsed as a string of arguments before the arguments that are displayed on the command line. For example:

ENSCRIPT='-fTimes-Roman8' 

sets your default body type size and font to 8-point Times Roman.

Information containing various media sizes for the psdit command and the enscript command are contained in the file /usr/lib/ps/MediaSizes.

The information required for each entry in the MediaSizes file can be obtained from the PostScript Printer Description, or PPD, file that matches the PostScript printer used with TranScript. The PPD files are available from Adobe Systems, Incorporated. The measurements extracted from the PPD files are expressed in a printer's measure called points. A printer's point is 1/72 of an inch.

Any line in the MediaSizes file beginning with an ASCII * (asterisk) is ignored when matching media-size names provided on the command line to the enscript command and the psdit command.

Each entry in the MediaSizes file contains either 8 or 9 fields. The first 8 fields are required for all entries. The 9th field is optional. Fields are separated by white space. The fields for each entry are as follows:

Field Name Description
EntryName Contains a character string to match against a media name provided with the -M flag with the enscript command or the psdit command.
MediaWidth Specifies the media width in points.
MediaDepth Specifies the media depth in points.
ImageableLLX Specifies the imageable lower left-hand corner x coordinate in points.
ImageableLLY Specifies the imageable lower left-hand corner y coordinate in points.
ImageableURX Specifies the imageable upper right-hand corner x coordinate in points.
ImageableURY Specifies the imageable upper right-hand corner y coordinate in points.
PageRegionName Specifies the PostScript sequence for the particular printer to identify the size of the imageable area.
PaperTrayName Specifies the PostScript sequence for the particular printer to select a particular paper/media tray. This field is optional.

Note: The sequence can be multiple PostScript operators or words for both the PageRegionName field and the PaperTrayName field. To specify such a sequence, use the ASCII " (double quote character) to delimit the entire sequence.

The following table shows examples of field entries in the MediaSizes file:

Name Width Depth llx lly urx ury Page- Region- Name Paper- Tray- Name
Letter 612 792 18 17 597 776 Letter

Legal 612 1008 18 17 597 992 Legal

PostScript Font Information

The PostScript Fonts for Transcript table shows the fonts available for the enscript command. The Font Name is specified with the -F and -f encscipt command flags. The alphabetic characters are case-sensitive:

PostScript Fonts for Transcript
Font Name Font Family
AvantGarde-Book AvantGarde
AvantGarde-Demi AvantGarde
AvantGarde-DemiOblique AvantGarde
AvantGarde-BookOblique AvantGarde
Bookman-Demi Bookman
Bookman-DemiItalic Bookman
Bookman-Light Bookman
Bookman-LightItalic Bookman
Courier Courier
Courier-Bold Courier
Courier-BoldOblique Courier
Courier-Oblique Courier
Garamond-Bold Garamond
Garamond-BoldItalic Garamond
Garamond-Light Garamond
Garamond-LightItalic Garamond
Helvetica Helvetica
Helvetica-Bold Helvetica
Helvetica-Oblique Helvetica
Helvetica-BoldOblique Helvetica
Helvetica-Narrow Helvetica
Helvetica-Narrow-Bold Helvetica
Helvetica-Narrow-BoldOblique Helvetica
Helvetica-Narrow-Oblique Helvetica
LubalinGraph-Book Lubalin
LubalinGraph-BookOblique Lubalin
LubalinGraph-Demi Lubalin
LubalinGraph-DemiOblique Lubalin
Miryam-Iso Miryam Iso
Miryam-IsoBold Miryam Iso
Miryam-IsoBoldItalic Miryam Iso
Miryam-IsoItalic Miryam Iso
NarkissimIso Narkissim Iso
NarkissimIso-Bold Narkissim Iso
NarkissimIso-BoldItalic Narkissim Iso
NarkissimIso-Italic Narkissim Iso
NarkissTamIso Narkiss Tam Iso
NarkissTamIso-Bold Narkiss Tam Iso
NarkissTamIso-BoldItalic Narkiss Tam Iso
NarkissTamIso-Italic Narkiss Tam Iso
NewCenturySchlbk NewCentury
NewCenturySchlbk-Bold NewCentury
NewCenturySchlbk-Italic NewCentury
NewCenturySchlbk-Roman NewCentury
Optima Optima
Optima-Bold Optima
Optima-BoldOblique Optima
Optima-Oblique Optima
Palatino-Bold Palatino
Palatino-BoldItalic Palatino
Palatino-Italic Palatino
Palatino-Roman Palatino
Rokaa Rokaa
Rokaa-Bold Rokaa
Rokaa-BoldItalic Rokaa
Rokaa-Italic Rokaa
Setting Setting
Setting-Bold Setting
Setting-BoldItalic Setting
Setting-Italic Setting
ShalomIso ShalomIso Iso
ShalomIso-Bold ShalomIso Iso
ShalomIso-BoldItalic ShalomIso Iso
ShalomIso-Italic ShalomIso Iso
Souvenir-Demi Souvenir
Souvenir-DemiItalic Souvenir
Souvenir-Light Souvenir
Souvenir-LightItalic Souvenir
Times-Bold Times
Times-BoldItalic Times
Times-Italic Times
Times-Roman Times
Typing Typing
Typing-Bold Typing
Typing-BoldItalic Typing
Typing-Italic Typing
Symbol (none)
ZapfChancery-MediumItalic Zapf
ZapfDingbats (none)

Parameters


SpoolerOptions Provides options for spooling the print file. The following are the SpoolerOptions flags:

{-d | -P}Queue
Queues the output to the named queue.

-nNumber
Produces the specified number of copies. The default is 1.

-tTitle
Sets job title for use on the first banner page.

File
Specifies the text file to be converted into PostScript format. If you leave this parameter blank, the enscript command reads from standard input.

Flags


-1 Sets in 1 column (the default).
-2 Sets in 2 columns.
-c Truncates (cuts) lines that are longer than the page width. Normally, long lines are wrapped around to the following line on the page.
-g Performs no function, but the -g flag is still accepted for backwards compatibility.
-k Enables page prefeed (if the printer supports it). This allows simple documents (such as program listings in a single font) to print somewhat faster by keeping the printer running between pages.
-l Simulates a line printer printing pages 66 lines long and omitting headers.
-m Sends mail after the files are printed.
-o Lists the missing characters if the enscript command cannot find characters in a font.
-q Causes the enscript command to not report about what it is doing. The enscript command cannot report on pages, destination, omitted characters, and so on. Fatal errors are still reported to the standard error output.
-r Rotates the output 90 degrees (landscape mode). Use this flag for output that requires a wide page or for program listings when used in conjunction with the -2 flag. The following example shows one way to get program listings:

enscript -2r File . . . 
-B Omits page headings.
-G Prints in gaudy mode, causing page headings, dates, and page numbers to be printed in a flashy style, at some slight performance expense.
-K Disables page prefeed (the default).
-R Prints in portrait mode (unrotated), which is the default.
-bHeader Sets the string to be used for page headings to the value of the Header variable. The default header is constructed from the file name, its last modification date, and a page number.
-fFont Sets the font to be used for the body of each page. The default is Courier10, unless the two-column rotated mode is used, in which case it defaults to Courier7.

Notes:
  1. A PostScript font name (such as Times-Roman, Times-BoldItalic, Helvetica, Courier).
  2. A point size (1 point = 1/72 inch). Fonts are specified in this fashion: Courier-Bold8 is 8-point Courier Bold; Helvetica12 is 12-point Helvetica.
-f0 Codeset:Font Sets the character codeset name, which is written into the PostScript file, and the SBCS font to use for the body of each page. The default is determined by the /usr/lib/ps/transcript.conf configuration file for each locale.
-f1 Codeset:Font Sets the character codeset name, which is written into the PostScript file, and the MBCS font to use for the body of each page. The default is determined by the /usr/lib/ps/transcript.conf configuration file for each locale.
-pOut Causes the PostScript file to be written to the named file rather than being spooled for printing. As a special case, entering the following will send the PostScript file to standard output:

-p -
-FHfont Sets the font to be used for page headings. The default is Courier Bold10.

Note: Font specifications have two parts:

  • A PostScript font name (such as Times-Roman, Times-BoldItalic, Helvetica, Courier).
  • A point size (1 point = 1/72 inch). Fonts are specified in this fashion: Courier-Bold8 is 8-point Courier Bold; Helvetica12 is 12-point Helvetica.
-F0 Codeset:Font Sets the character codeset name, which is written into the PostScript file, and the SBCS font to use for the header of each page. The default is determined by the /usr/lib/ps/transcript.conf configuration file for each locale.
-F1 Codeset:Font Sets the character codeset name, which is written into the PostScript file, and the MBCS font to use for the header of each page. The default is determined by the /usr/lib/ps/transcript.conf configuration file for each locale.
-LLines Sets the maximum number of lines to print on a page. The enscript command usually computes how many lines to put on a page based on point size. (It might put fewer per page than requested by the -L flag.)
-MMediaName Specifies a media name to use to determine the amount of imageable area on the paper. The name provided is matched against entries in the MediaSizes file. For instance, -M legal would request a legal size of paper as the imageable area. If this flag is not used, the default size is letter size, which is 8.5 inches wide by 11.0 inches deep (21.6 cent. wide by 27.9 cent. deep).
-XCodesetName Specifies the code set for the input data. By default, the input code set is determined by the nl_langinfo subroutine. If this flag is used, the codeset is determined by the CodesetName.

International Character Support

All characters not found in a font will be replaced with the character ? (question mark). For a complete list of characters that were not found, use the -o flag. The NLSvec file provides information about character translation.

Environment Variables


ENSCRIPT Specifies a string of options to be used by the enscript command.
LPDEST Specifies a printer destination. The -d spooler option overrides this environment variable.
PSLIBDIR Provides a path name of a directory to use instead of the /usr/lib/ps directory for the enscript command prologue and font metric files.
PSTEMPDIR Provides a path name of temporary directory to use instead of the /var/tmp directory of spooled temporary files.
TRANSCRIPT Provides the absolute path name of a file to use, instead of the /usr/lib/ps/transcript.conf configuration file, for MBCS handling.

Files


/usr/lib/ps/*.afm Contains Adobe Font Metrics (AFM) files.
/usr/lib/ps/font.map Contains the list of font names with their abbreviations.
/usr/lib/ps/enscript.pro Contains prologue for enscript command files.
/usr/lib/ps/MediaSizes Contains the default file used for media sizes.

Related Information

The col command, eqn command, lp command, managefonts command, nroff command, pic command, pr command, ps630 command, psdit command, refer command, tbl command, troff command.

The nl_langinfo subroutine.

NLSvec File provides information about character translation.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]