SysTutorials

Man Pages › Section 1

enscript(1)

NAME

enscript – convert text files to PostScript, HTML, RTF, ANSI, and overstrikes

SYNOPSIS

enscript [-123456789BcgGhjkKlmOqrRvVzZ] [-# copies] [-a pages] [-A align] [-b header] [-C[start_line]] [-d printer] [-D key[:value]] [-e[char]] [-E[lang]] [-f font] [-F header_font] [-H[num]] [-i indent] [-I filter] [-J title] [-L lines_per_page] [-M media] [-n copies] [-N newline] [-o outputfile] [-o –] [-p outputfile] [-p –] [-P printer] [-s baselineskip] [-S key[:value]] [-t title] [-T tabsize] [-u[text]] [-U num] [-w language] [-X encoding] [filename …]

DESCRIPTION

Enscript converts text files to PostScript or to other output languages. Enscript can spool the generated output directly to a specified printer or leave it to a file. If no input files are given, enscript processes the standard input stdin. Enscript can be extended to handle different output media and it has many options which can be used to customize the printouts.

OPTIONS

-# num

Print num copies of each page.

-1, -2, -3, -4, -5, -6, -7, -8, -9, –columns=num

Specify how many columns each page have. With the long option –columns=num you can specify more than 9 columns per page.

-a pages, –pages=pages

Specify which pages are printed. The page specification pages can be given in the following formats:

begin–end

print pages from begin to end

–end

print pages from 0 to end

begin–

print pages from begin to end

page

print page page

odd

print odd pages

even

print even pages
-A align, –file-align=align

Align separate input files to even align page count. This option is useful in two-side and 2-up printings (–file-align=2).

-b header, –header=header

Use the text header as a page header. The default page header is constructed from the name of the file and from its last modification time.

The header string header can contain the same formatting escapes which can be specified for the %Format directives in the user defined fancy headers. For example, the following option prints the file name, current date and page numbers:

enscript –header=’$n %W Page $% of $=’ *.c

The header string can also contain left, center and right justified fields. The fields are separated by the ‘|’ character:

enscript –header=’$n|%W|Page $% of $=’ *.c

now the file name is printed left justified, the date is centered to the header and the page numbers are printed right justified.

-B, –no-header

Do not print page headers.

-c, –truncate-lines

Cut lines that are too long for the page. As a default, enscript wraps long lines to the next line so no information is lost.

You can also use the –slice option which slices long lines to separate pages.

-C[start_line], –line-numbers[=start_line]

Precede each line with its line number. The optional argument start_line specifies the number of the first line in the input. The number of the first line defaults to 1.

-d name

Spool output to the printer name.

-D key[:value], –setpagedevice=key[:value]

Pass a page device definition to the generated PostScript output. If no value is given, the key key is removed from the definitions.

For example, the command

enscript -DDuplex:true foo.txt

prints file foo.txt in duplex (two side) mode.

Page device operators are implementation dependent but they are standardized. See section PAGE DEVICE OPTIONS for the details.

-e[char], –escapes[=char]

Enable special escapes interpretation (see section SPECIAL ESCAPES). If the argument char is given, it changes the escape character to char. The default escape character is 0.

-E[lang], –highlight[=lang]

Highlight source code by creating a special input filter with the states program. The optional argument lang specifies the language to highlight. As a default the states makes an educated guess.

You can print a short description of the supported highlighting languages and file formats with the command:

enscript –help-highlight

The highlighting rules are defined in the `/usr/share/enscript/hl/*.st’ files which can be edited to create highlighting definitions for new languages.

Note! You can not use your own input filters with this option.

-f name, –font=name

Select a font that is used for the body text. The default body font is Courier10, unless multicolumn landscape printing mode is selected, in which case the default font is Courier7.

The font specification name contains two parts: the name of the font and its size in PostScript points. For example, "Times-Roman12" selects the "Times-Roman" font with size 12pt.

The font specification name can also be given in format `name@ptsize‘, where the name of the font and its point size are separated by a `@’ character. This allows enscript to use fonts which contain digit characters in their names.

The font point size can also be given in the format width/height where the width and the height specify the size of the font in x- and y-directions. For example, "Times-Roman@10/12" selects a 10 points wide and 12 points high "Times-Roman" font.

You can also give the font sizes as decimal numbers. For example, "Times-Roman10.2" selects a 10.2pt "Times-Roman" font.

-F name, –header-font=name

Select a font for the header texts.

-g, –print-anyway

Print a file even if it contains binary data. The option is implemented only for compatibility purposes. Enscript prints binary files anyway regardless of the option.

-G, –fancy-header[=name]

Print a fancy page header name to the top of each page. The option -G specifies the default fancy header. See section CONFIGURATION FILES to see how the default fancy header can be changed.

-h, –no-job-header

Suppress printing of the job header page.

-H[num], –highlight-bars[=num]

Specify how high the highlight bars are in lines. If the num is not given, the default value 2 is used. As a default, no highlight bars are printed.

-i num, –indent=num

Indent every line num characters. The indentation can also be specified in other units by appending an unit specifier after the number. The possible unit specifiers and the corresponding units are:

c

centimeters

i

inches

l

characters (default)

p

PostScript points
-I filter, –filter=filter

Read all input files through an input filter filter. The input filter can be a single command or a command pipeline. The filter can refer to the name of the input file with the escape `%s‘. The name of the standard input can be changed with the option `–filter-stdin‘.

For example, the following command prints the file `foo.c’ by using only upper-case characters:

enscript –filter=cat %s | tr ‘a-z’ ‘A-Z’ foo.c

The following command highlights changes which are made to files since the last checkout:

enscript –filter=rcsdiff %s | diffpp %s -e *.c

To include the string "%s" to the filter command, you must write it as "%%s".

-j, –borders

Print borders around columns.

-J title

An alias for the option -t, –title.

-k, –page-prefeed

Enable page prefeed.

-K, –no-page-prefeed

Disable page prefeed (default).

-l, –lineprinter

Emulate lineprinter. This option is a shortcut for the options –lines-per-page=66, and –no-header.

-L num, –lines-per-page=num

Print only num lines for each page. As a default, the number of lines per page is computed from the height of the page and from the size of the font.

-m, –mail

Send a mail notification to user after the print job has been completed.

-M name, –media=name

Select an output media name. Enscript‘s default output media is determined from libpaper and falls back to A4.

-n num, –copies=num

Print num copies of each page.

-N nl, –newline=nl

Select the newline character. The possible values for nl are: n (unix newline, 0xa hex) and r (mac newline, 0xd hex).

-o file

An alias for the option -p, –output.

-O, –missing-characters

Print a listing of character codes which couldn’t be printed.

-p file, –output=file

Leave the output to file file. If the file is `-‘, enscript sends the output to the standard output stdout.

-P name, –printer=name

Spool the output to the printer name.

-q, –quiet, –silent

Make enscript really quiet. Only fatal error messages are printed to stderr.

-r, –landscape

Print in the landscape mode; rotate page 90 degrees.

-R, –portrait

Print in the portrait mode (default).

-s num, –baselineskip=num

Specify the baseline skip in PostScript points. The number num can be given as a decimal number. When enscript moves from line to line, the current point y coordinate is moved (font point size + baselineskip) points down. The default baseline skip is 1.

-S key[:value], –statusdict=key[:value]

Pass a statusdict definition to the generated PostScript output. If no value is given, the key key is removed from the definitions.

The statusdict operators are implementation dependent; see the printer’s documentation for the details.

For example, the command

enscript -Ssetpapertray:1 foo.txt

prints the file foo.txt by using paper from the paper tray 1 (assuming that the printer supports paper tray selection).

-t title, –title=title

Set banner page’s job title to title. The option sets also the name of the input file stdin.

-T num, –tabsize=num

Set the tabulator size to num characters. The default is 8.

-u[text], –underlay[=text]

Print the string text under every page. The properties of the text can be changed with the options –ul-angle, –ul-font, –ul-gray, –ul-position, and –ul-style.

If no text is given, the underlay is not printed. This can be used to remove an underlay text that was specified with the `Underlay‘ configuration file option.

-U num, –nup=num

Print num logical pages on each output page (N-up printing). The values num must be a power of 2.

-v, –verbose[=level]

Tell what enscript is doing.

-V, –version

Print enscript version information and exit.

-w [lang], –language[=lang]

Generate output for the language lang. The possible values for lang are:

PostScript

generate PostScript (default)

html

generate HTML

overstrike

generate overstrikes (line printers, less)

rtf

generate RTF (Rich Text Format)

ansi

generate ANSI terminal control codes
-X name, –encoding=name

Use the input encoding name. Currently enscript supports the following encodings:

88591, latin1

ISO-8859-1 (ISO Latin1) (enscript‘s default encoding).

88592, latin2

ISO-8859-2 (ISO Latin2)

88593, latin3

ISO-8859-3 (ISO Latin3)

88594, latin4

ISO-8859-4 (ISO Latin4)

88595, cyrillic

ISO-8859-5 (ISO Cyrillic)

88597, greek

ISO-8859-7 (ISO Greek)

88599, latin5

ISO-8859-9 (ISO Latin5)

885910, latin6

ISO-8859-10 (ISO Latin6)

ascii

7-bit ascii

asciifise, asciifi, asciise

7-bit ascii with some scandinavian (Finland, Sweden) extensions

asciidkno, asciidk, asciino

7-bit ascii with some scandinavian (Denmark, Norway) extensions

ibmpc, pc, dos

IBM PC charset

mac

Mac charset

vms

VMS multinational charset

hp8

HP Roman-8 charset

koi8

Adobe Standard Cyrillic Font KOI8 charset

ps, PS

PostScript font’s default encoding

pslatin1, ISOLatin1Encoding

PostScript interpreter’s `ISOLatin1Encoding’
-z, –no-formfeed

Turn off the form feed character interpretation.

-Z, –pass-through

Pass through all PostScript and PCL files without any modifications. This allows that enscript can be used as a lp filter.

The PostScript files are recognized by looking up the `%!’ magic cookie from the beginning of the file. Note! Enscript recognized also the Windoze damaged `^D%!’ cookie.

The PCL files are recognized by looking up the `^[E’ or `^[%’ magic cookies from the beginning of the file.

–color[=bool]

Use colors in the highlighting outputs.

–download-font=fontname

Include the font description file (.pfa or .pfb file) of the font fontname to the generated output.

–extended-return-values

Enable extended return values. As a default, enscript returns 1 on error and 0 otherwise. The extended return values give more details about the printing operation. See the section RETURN VALUE for the details.

–filter-stdin=name

Specify how the stdin is shown to the input filter. The default value is an empty string ("") but some programs require that the stdin is called something else, usually "-".

–footer=footer

Use the text footer as a page footer. Otherwise the option works like the –header option

–h-column-height=height

Set the horizontal column height to be height PostScript points. The option sets the formfeed type to horizontal-columns.

–help

Print a short help message and exit.

–help-highlight

Describe all supported –highlight languages and file formats.

–highlight-bar-gray=gray

Specify the gray level which is used in printing the highlight bars.

–list-media

List the names of all known output media and exit successfully.

–margins=left:right:top:bottom

Adjust the page marginals to be exactly left, right, top and bottom PostScript points. Any of the arguments can be left empty in which case the default value is used.

–mark-wrapped-lines[=style]

Mark wrapped lines in the output with the style style. The possible values for the style are:

none

do not mark them (default)

plus

print a plus (+) character to the end of each wrapped line

box

print a black box to the end of each wrapped line

arrow

print a small arrow to the end of each wrapped line
–non-printable-format=format

Specify how the non-printable characters are printed. The possible values for the format are:

caret

caret notation: `^@’, `^A’, `^B’, …

octal

octal notation: `