From: Bill Reynolds (bill@yossarian.ucsd.edu)
Date: 07/09/93


From: bill@yossarian.ucsd.edu (Bill Reynolds)
Subject: Re: Configuring HP LJ III
Date: 9 Jul 1993 10:54:11

In article <C9wHty.Csq@nocusuhs.nnmc.navy.mil> SSB1PZP@imcvms.med.navy.mil (PERUCCI, PHILIP A.) writes:

   In <1d.5851.2268.0NAC7B33@synapse.org> irwin.nemetz@synapse.org writes:

>
> Sorry if this is a dumb question but I am new to Unix systems. What
> do I have to do to get "readable" output out of my Laserjet III
> printer ? I have looked at the man pages relating to the printcap
> file but I am still lost. What I get is what I think is called
> "stepping", where the following line appears farther and farther to
> the right on the page.
>
> Any help would be appreciated.
>

   The HP needs to be told to interpret LF codes as CR/LF. This is done
   by sending a short escape-code sequence to the HP. You MAY be able to
   do this from the front panel, I don't know...

   On AT&T 3B2 boxes (god help us), this goes in the interface script for the
   printer. Anyone know what the Linux equivalent is?

This one is in the lpd FAQ:

How
    do
       I
         prevent
                 this?

Unix terminates each line of a file with a linefeed but not a carriage
return. Some printers can be set to treat LF as CRLF, others can't. If
yours can then do simply do that. If the printer cannot be fixed create
a shell script filter that reads:

#!/bin/sh
if [ $1 = -c ]; then
  cat
else
  sed -e s/$/^M/
fi
echo -ne \\f

where ^M is a carriage return character not a ^ followed by a M. To
type ^M in emacs use the sequence C-q C-m. Conventionally this script
is called /usr/lib/lpf.

Alternatively your printer may have an escape sequence that will set
the way it handles linefeed characters. A simple filter that uses an
`echo -ne' command to send this sequence may be appropriate.

#!/bin/sh
# Filter for HP printers to treat LF as CRLF
echo -ne \\033&k2G
cat
echo -ne \\f

======================================================================