LinuxCommandLibrary

enscript

convert text files to PostScript for printing

TLDR

Print file to default printer

$ enscript [file]
copy
Generate PostScript output
$ enscript -o [output.ps] [file]
copy
Print two columns
$ enscript -2 [file]
copy
Print with syntax highlighting
$ enscript -E [file.c]
copy
Print landscape
$ enscript -r [file]
copy
Print with header
$ enscript -b "[Header Text]" [file]
copy
Print line numbers
$ enscript -C [file]
copy

SYNOPSIS

enscript [options] [file...]

DESCRIPTION

enscript converts text files to PostScript, HTML, or RTF for printing or viewing. It provides advanced formatting capabilities including multi-column output, headers, footers, and syntax highlighting for numerous programming languages.
The tool is widely used for generating professional-looking printouts of source code and documentation. It can automatically detect file types and apply appropriate syntax highlighting, making code more readable when printed.
enscript supports customization through configuration files and command-line options, allowing control over fonts, page layout, borders, and output format. It's particularly useful in development environments for code reviews and documentation.

PARAMETERS

-o file

Output to file instead of printer.
-E [lang]
Syntax highlighting.
-2
Two-column output.
-r
Landscape orientation.
-b header
Page header.
-C
Print line numbers.
-f font
Body font.
-F font
Header font.
-p printer
Select printer.
--color
Color output.

CONFIGURATION

/etc/enscript.cfg

System-wide configuration file for default settings.
~/.enscriptrc
User-specific configuration file for personal preferences.

SEE ALSO

a2ps(1), lpr(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community