Previous Section  < Day Day Up >  Next Section

Recipe 1.9. Printing info Pages

1.9.1 Problem

You want to print some info pages, but there doesn't seem to be a built-in print command for info.

1.9.2 Solution

You can use lpr:

$ info finger | lpr

However, this may result in too-small margins and odd line breaks, depending on your printer defaults. Use lpr options to format it:

$ info finger | lpr -o cpi=12 -o page-left=54 -o page-right=54 -o page-top=54 \

 -o page-bottom=54

The numbered values are points, or 1/72". This example creates 3/4" margins all the way around. cpi=12 sets the number of characters to 12 per inch. All of these options are documented in the CUPS Software Users Manual, at http://localhost:631/documentation.html.

1.9.3 Discussion

All of the major Linux distributions ship with CUPS, the Common Unix Printing System. CUPS supports both the System V (lp) and Berkeley (lpr) commands. This recipe uses the Berkeley commands. Here are the System V equivalents.

To print an info page use:

$ info finger | lp

To print the info page using lp's formatting options use:

$ info finger | lp -o cpi=12 -o page-left=54 -o page-right=54 -o page-top=54 \

-o page-bottom=54

1.9.4 See Also

  • info info, lpr(1), lp(1)

  • Chapter 14

  • CUPS Software Users Manual (http://localhost:631/documentation.html)

    Previous Section  < Day Day Up >  Next Section