LinuxDevCenter.com
oreilly.comSafari Books Online.Conferences.

advertisement


Outputting Text
Pages: 1, 2, 3

Printing a poster or sign

Enscript is useful for making a quick-and-dirty sign from a text file. For example, suppose the text file "sign" contains the following text:



CAUTION

WET PAINT!

You can print a sign out of it by specifying a large font, such as Helvetica Bold at 72 points, and omitting the default headers:

$ enscript -B -f "Helvetica-Bold72" sign RET

Getting fancy with headers

You can customize the header text by quoting the text you want to use as an argument to the -b option. Use the special symbol "$%" to specify the current page. For example:

$ enscript -b "Page $% of the annual report" report.txt RET

Use the -G option to output text with graphic headers, with the header text set in blocks of various shades of grey. You can create your own custom fancy headers, too -- the way to do this is described in the CUSTOMIZATION section of the enscript man page.

Outputting in landscape mode

To output text in landscape mode -- where the entire text is rotated 90 degrees counterclockwise -- use the -r option.

To print the contents of the text file report.txt in landscape mode and with text set in 28-point Times Roman, type:

$ enscript -r -f "Times-Roman28" report.txt RET

Selecting the pages to output

To specify which pages are output, give the range of number(s) as arguments to the -a option. To print just the odd or even pages, use the special odd and even arguments. This is good for printing double-sided pages: first print the odd, and then feed the output pages back into the printer and print the even.

For example, to print the odd pages of the text file report.txt, type:

$ enscript -a odd report.txt RET

Then, to print the even, type:

$ enscript -a even report.txt RET

Language highlighting

Enscript recognizes the formatting of more than 40 languages and formats, from the Perl and C programming languages to HTML, and can highlight portions of the text based on its syntax; there's also one for email and news articles, called "mail", that highlights the message header lines. In Unix-speak, this is called "pretty-printing."

Give the name of the language or format with the -E option (be careful not to put a space between the E and the language name). For example, to pretty-print the HTML file index.html, type:

$ enscript -Ehtml index.html RET

To pretty-print an email saved to the file "important-mail", type:

$ enscript -Email important-mail RET

 

Pages: 1, 2, 3

Next Pagearrow




Linux Online Certification

Linux/Unix System Administration Certificate Series
Linux/Unix System Administration Certificate Series — This course series targets both beginning and intermediate Linux/Unix users who want to acquire advanced system administration skills, and to back those skills up with a Certificate from the University of Illinois Office of Continuing Education.

Enroll today!


Linux Resources
  • Linux Online
  • The Linux FAQ
  • linux.java.net
  • Linux Kernel Archives
  • Kernel Traffic
  • DistroWatch.com


  • Sponsored by: