Subject: Re: Problem with CR/LF Printing Text to HP LaserJet--Progress
To: None <skidmore@macconnection.net>
From: Greg A. Woods <woods@weird.com>
List: netbsd-users
Date: 10/22/2003 14:35:37
[ On Wednesday, October 22, 2003 at 12:33:22 (+0700), Robert Elz wrote: ]
> Subject: Re: Problem with CR/LF Printing Text to HP LaserJet--Progress 
>
> You are going to need 2 printcap entries.  The first has filters,
> and lp=/dev/null or something like that.

Why not use "lpd -r" and then he can use an input or output filter with
a remote printer?  I haven't tried this myself, but I looked briefly at
the code after it was suggested the first time on this thread and it
does seem on first glance that it should work.

Indeed on first glance it seems as if just using the "default"
/usr/libexec/lpr/lpf as the output filter, with its '-f' option, may
even fix the staircase problem, though unfortunately it seems there is
not yet any way to pass the '-f' to the "of" program.  That would be
quite easy to fix, but does require hacking lpd and thinking of some
logical way to specify when to do so (perhaps another flag in printcap).

> And NetBSD people, we're doing a lousy job of assisting here, as people
> aren't bothering to understand the problem before replying.

Indeed.  :-)

I was also going to suggest that if the printer can speak Ethertalk then
installing netatalk and using PAP would allow filters to work properly,
(which is what I do with my ALW 16/600PS since it's inboard LPD-like
print spooler screws up if two jobs hit it at the same time from
different hosts).  However running netatalk on the SE 30 might be a bit
much to ask for (never mind trying to compile it! ;-).

Also, though I don't know much about the HP LaserJet spooler, I do know
that the one in the ALW-16 does magic with the remote printer name.

For example if I were not using netatalk I would be using the following
printcap entries.  Perhaps the same magic insertion of CR will work with
some magic remote printer name in the LaserJet spooler too.

# Entries suitable for an Apple LaserWriter with TCP/IP (eg. 16/600PS)
#
# the remote printer name (rp) specifies how the printer will treat the
# input data.  "raw" is suitable for PostScript or HP PCL-5 output, and
# "text" is suitable for ASCII (an ASCII CR is appended to every line so
# as to avoid the stair-step effect when printing Unix text files)
#
# The printer's Ethernet port should be configured to "AutoSelect" for
# TCP/IP, which is the default on a 16/600PS if the configuration switch
# is in the "down" position.
#
# it would be possible for an input filter to do accounting for the
# "remtext" printer, but that's almost impossible for any PostScript
# printer, and not easy for any PCL printer.
#
remtext|remalwtext|Apple LaserWriter w/TCP-IP as a text printer:\
	:rm=alw16.weird.com:\
	:rp=text:\
	:mx#0:sf:sh:sb:\
	:rg=staff:rs:\
_       :sd=/var/spool/output/remalwtext:\
	:lf=/var/log/lpd-errs:

remps|rempcl|remalw16|Apple LaserWriter w/TCP-IP as a PostScript or PCL-!
	:rm=alw16.weird.com:\
	:rp=raw:\
	:mx#0:sf:sh:sb:\
	:rg=staff:rs:\
	:sd=/var/spool/output/remalw16:\
	:lf=/var/log/lpd-errs:

# However with netatalk the built-in spooler problems can be ignored and
# you can get page accounting to work as well with this entry
#
lp|ps|pcl|alw|alw16|LaserWriter 16/600 PS on AppleTalk:\
	:pw#80:hl:\
	:mx#0:sf:sh:sb:\
	:rg=staff:rs:\
	:sd=/var/spool/output/alw16:\
	:lp=/dev/null:\
	:af=/var/account/alw16_lpr:\
	:lf=/var/log/lpd-errs:\
	:of=/usr/pkg/libexec/netatalk/ofpap:\
	:if=/usr/pkg/libexec/netatalk/ifpap:\
	:tf=/usr/pkg/libexec/netatalk/tfpap:\
	:df=/usr/pkg/libexec/netatalk/dfpap:

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>