Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lpr for long lines of text

Status
Not open for further replies.

jawon

Programmer
Feb 6, 2003
31
0
0
US
I'm using the "lpr" command to print to a network printer but the file contains long lines of text between line breaks so the lines bleed off the page and do not get printed. So how can I get all the text printed?
 
man pr

pr -w MyPageWidth | lpr

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
If you send plain text file you can consider the
Code:
 fold
command.
If your report contains some escape sequence, you're in trouble if you don't know how to tell the printer to break the long lines.

Hope This Help
PH.
 
Depends on the printer whether there is a landscape and whether your printer definitions have a matching capability.
You could possibly set the printer to linewrap long lines but that will screw up your paging through the spooler.

Ed Fair
Give the wrong symptoms, get the wrong solutions.
 
I used provide '-o something' to 'lp' based on the printer model/capabilties.... I think the model(s) used to be defined under '/usr/lib/lp/model' [Solaris]....

That's been ages ago - don't quite remember all the details.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
or this :

prints a file, with an 8 space left margin with lines folded to fit on a page
#
old=`pwd`
for i in $*
do
if [ ! -d $i ]; then
fold -w 72 $i > /var/tmp/`basename $i`
cd /var/tmp
pr -l60 -o8 `basename $i` | lp
rm /var/tmp/`basename $i`
cd $old
fi
done


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top