Subject: Re: Problem with CR/LF Printing Text to HP LaserJet--Progress
To: None <skidmore@macconnection.net>
From: Johnny Billquist <bqt@update.uu.se>
List: netbsd-users
Date: 10/21/2003 21:00:28
On Tue, 21 Oct 2003 skidmore@macconnection.net wrote:

> As a reminder, I am using NetBSD 1.6.1 on a mac68k, and am having problems
> getting stair-stepped output when I print text to a remote HP LaserJet.
> 
> I have been looking at the mailing list archives, and have made some progress,
> but still would like assistance.

Install magicfilter from the pkgsrc, and proceed from there.

> The first thing I learned looking at the Man page for lpd, is that you must
> use the -r option when starting the daemon if you want it to process
> 'if' or 'of' filters, otherwise they are ignored.

No, they are ignored for remote printers unless you have -r. Local
printers always use if and of.

> The second thing I learned is that putting a trailing '\' after the
> 'if' statement in printcap causes it to be ignored:
> 
>         :if=/usr/libexec/filters/hpif:\
>                                       ^
>         This gives stair-stepped printing, just like leaving the 'if'
>         statement out.

Looking at hpif, it seems as if it tries to reconfigure the printer.
That means it will only work if you really have a printer that understands
that specific escape sequence.

> However, when I leave the '\' out, I am completely unable to print, and
> get an error message.
> 
>         :if=/usr/libexec/filters/hpif:
> 
>         This results in _no_ output, and the following error:
>         'lpd[1374]: /dev/lp: No such file or directory'

Hmm. Did you also leave out the newline at the end perhaps?
(A very common error people do. The last line of a file does not
automatically have a newline, M$ programs usually append one, so people
from that world often are not aware that this "problem" might exist.)

Anyhow. My first suggestion would be to use magicfilter. If will allow you
to print not only ascii files, but a bunch of other things as well, as
long as you don't have a very funny printer.

> Do I need to create a file named 'lp' in /dev that points to /usr/bin/lp?
> If so, I have not found documentation of how to do that.

No. /dev/lp is the physical device that the printer is expected to be
on. It is either named in /etc/printcap (lp), or if not specified if might
default to /dev/lp.
If you don't know how devices work in Unix we might take that part next...

	Johnny

Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt@update.uu.se           ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol