Skip navigation

STANFORD UNIVERSITY

INFORMATION TECHNOLOGY SERVICES

Advanced Printing

enscript and Other Advanced Commands

The enscript command can be used to print plain-text files in a rotated, two-column format. This can help reduce paper waste and save money on the cost of a print job. The command takes a single argument specifying the file to be printed and requires two options, -2r and -P, describing the number and format of columns and specifying a particular target printer; for example:

enscript -2r -Psweet1 file.txt

The UNIX man pages for this command have additional information. Please note that the print accounting system currently charges users an additional 10¢ when printing with the enscript command; e.g., an 8-page document reduced to 4 printed pages using enscript will cost 50¢ to print, not 40¢ as expected. This may change as print accounting is improved.

Do not use the enscript command to print PostScript files, as it supports printing only plain-text data. To print PostScript files in a similar format, use the psnup command instead. This command takes a single argument specifying the file to be printed and requires a single option, -2, describing the number of columns to be used per printed page. The psnup command simply performs a transformation on PostScript input and does not print; for this reason, you must use a "pipe" to transfer the output of the command to lpr:

psnup -2 file.ps | lpr -Psweet1

Some applications produce PostScript data with a format too wide to be rotated and resized by the psnup command, causing some lines of text to be truncated when printed. The psresize command can be used to reduce the scale of improperly formatted PostScript files, allowing them to be handled correctly by psnup; for example:

psresize -W8.5in -w8in file.ps | psnup -2 | lpr -Psweet1

Printing from a Remote Location

When connecting from a remote location it may be possible to print to a locally attached printer using the mpr command. Please note that the mpr command is not well supported; however, it should work with recent versions of Samson and other terminal emulators that support ANSI printing.

The mpr command takes a single argument specifying the file to be printed and allows one of two options, -p or -h, specifying the type of the target printer (PostScript or PCL). The most basic form of the command can be used to print simple, plain-text files:

mpr file.txt

If the attached device is a PostScript printer it may be necessary to specify PostScript formatting for plain-text files:

mpr -p file.txt

PostScript printers should also be able to support native printing of PostScript-formatted files:

mpr file.ps

Finally, some HP printers require the specification of PCL formatting for plain-text files:

mpr -h file.txt
Last modified Monday, 14-Aug-2006 01:26:44 PM

Stanford University Home Page