Notice! This document is currently in Archived status.
The content of this document may be incorrect or outdated.

Print this article Edit this article

Command Line Printing: Printing Text Files as PostScript With Enscript

Examples
On a BSD-compatible system, to convert and print the text file myfile.txt to printer ps99 without a banner page, you would enter at the Unix prompt:

enscript -Pps99 -h myfile.txt

To make a PostScript file of the text file myfile.txt and save it as myfile.ps, you would enter:

enscript -pmyfile.ps myfile.txt

To redirect the output of enscript as input for another command, append another dash to the -p option, for example:

enscript -2rG -p- myfile.txt | psduplex | lpr -Pps99 -h

This will convert myfile.txt into a two-column, rotated PostScript file with a large header, send it through the psduplex filter to print on both sides of the paper, and finally print the result without a banner page to the printer named ps99.

For more information about enscript, read its man page by entering the following:

man enscript
 

Last Modified: Dec 19, 2016 11:12 am US/Eastern
Created: Oct 8, 2007 9:36 am GMT-4 by admin
JumpURL: