Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How do I set the number of characters per line when printing a file using lp or lpr? It seems like it's fixed at 80.

share|improve this question
add comment

1 Answer

You can set the number of characters per inch with -o cpi and the margins in points (72 per inch) with -o page-left and -o page-right. For example:

       lp -d main -o cpi=10 -o lpi=8 -o page-left=72 -o page-right=72 filename

would print 75 characters per line (assuming a fixed width font and an 8.5 inch wide page).

From man lp on a CUPS-based system (Ubuntu 9.10):

Example:
       Print a text file with 12 characters per inch, 8 lines per inch, and  a
       1 inch left margin:
           lp -d bar -o cpi=12 -o lpi=8 -o page-left=72 filename

and

       -o cpi=N
            Sets the number of characters per inch to use when printing a text
            file. The default is 10.

       -o lpi=N
            Sets the number of lines per inch to  use  when  printing  a  text
            file. The default is 6.

       -o page-bottom=N

       -o page-left=N

       -o page-right=N

       -o page-top=N
            Sets  the page margins when printing text files. The values are in
            points - there are 72 points to the inch.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.