enscript (1) Linux Manual Page
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. -apages, –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
-Aalign, –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).
-bheader, –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
%Formatdirectives 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 $=’ *.cThe header string can also contain left, center and right justified fields. The fields are separated by the
‘|’character:enscript –header=’$n|%W|Page $% of $=’ *.cnow 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,
enscriptwraps long lines to the next line so no information is lost.You can also use the
–sliceoption 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.
-dname- Spool output to the printer name.
-Dkey[: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.txtprints file foo.txt in duplex (two side) mode.
Page device operators are implementation dependent but they are standardized. See section
PAGE DEVICE OPTIONSfor 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
statesprogram. The optional argument lang specifies the language to highlight. As a default thestatesmakes an educated guess.You can print a short description of the supported highlighting languages and file formats with the command:
enscript –help-highlightThe 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. -fname, –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 isCourier7.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
enscriptto 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. -Fname, –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.
Enscriptprints 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
-Gspecifies the default fancy header. See sectionCONFIGURATION FILESto 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.
-inum, –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
-Ifilter, –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.cThe following command highlights changes which are made to files since the last checkout:
enscript –filter=rcsdiff %s | diffpp %s -e *.cTo include the string "%s" to the filter command, you must write it as "%%s".
-j, –borders- Print borders around columns.
-Jtitle- 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. -Lnum, –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.
-Mname, –media=name- Select an output media name.
Enscript‘s default output media is determined from libpaper and falls back toA4. -nnum, –copies=num- Print num copies of each page.
-Nnl, –newline=nl- Select the newline character. The possible values for nl are:
n(unix newline, 0xa hex) andr(mac newline, 0xd hex). -ofile- An alias for the option
-p,–output. -O, –missing-characters- Print a listing of character codes which couldn’t be printed.
-pfile, –output=file- Leave the output to file file. If the file is `-‘, enscript sends the output to the standard output
stdout. -Pname, –printer=name- Spool the output to the printer name.
-q, –quiet, –silent- Make
enscriptreally 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).
-snum, –baselineskip=num- Specify the baseline skip in PostScript points. The number num can be given as a decimal number. When
enscriptmoves from line to line, the current point y coordinate is moved (font point size + baselineskip) points down. The default baseline skip is 1. -Skey[: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.txtprints the file foo.txt by using paper from the paper tray 1 (assuming that the printer supports paper tray selection).
-ttitle, –title=title- Set banner page’s job title to title. The option sets also the name of the input file
stdin. -Tnum, –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. -Unum, –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
enscriptis doing. -V, –version- Print
enscriptversion 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
-Xname, –encoding=name- Use the input encoding name. Currently
enscriptsupports 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
enscriptcan be used as a lp filter.The PostScript files are recognized by looking up the `%!’ magic cookie from the beginning of the file.
Note!Enscriptrecognized 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,
enscriptreturns 1 on error and 0 otherwise. The extended return values give more details about the printing operation. See the sectionRETURN VALUEfor the details. –filter-stdin=name- Specify how the
stdinis shown to the input filter. The default value is an empty string ("") but some programs require that thestdinis called something else, usually "-". –footer=footer- Use the text footer as a page footer. Otherwise the option works like the
–headeroption –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
–highlightlanguages 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: `
