Printing a text file with lpr
produces output with a large Monaco font and very thin margins. Is there a way to change the font and the margins when you use lpr
on OS X?
2 Answers
lp
allows you to specify margins and text size. According to the man lp
:
-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.
EXAMPLES
Print a double-sided legal document to a printer called "foo":
lp -d foo -o media=legal -o sides=two-sided-long-edge filename
Print an image across 4 pages:
lp -d bar -o scaling=200 filename
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
I defined a command mylpr
(in ~/bin) as follows:
#!/bin/bash
ENSCRIPT="--no-header --margins=36:36:36:36 --font=Courier11 --word-wrap --media=Letter"
export ENSCRIPT
/usr/bin/enscript -p - $1 | /usr/bin/lpr
then I also added lines
(require 'lpr)
(setq my-print-command "~/bin/mylpr")
(setq lpr-command my-print-command)
to my ~/.emacs
and ~/.xemacs/custom.el
files. This took care of all my instances of printing in 12-pt Monaco without margins.
-
oops... I hope what I posted above is clear enough... I can't edit or comment, so I thank any other user who will do it. Notice that there should be a ";", or a new line, after "export ENSCRIPT".– user119153Feb 19, 2012 at 20:04
-