Subject: HP LaserJet6L setup problem
To: None <netbsd-help@NetBSD.ORG>
From: Fujie Zhang <fzhang@NMSU.Edu>
List: netbsd-help
Date: 07/12/1998 05:47:14
i'm still struggling to set up HP LaserJet6L. i hacked a filter file,
modified the /etc/printcap file and enabled lpd in /etc/rc.conf. but i
did not get any output when i tried to print a simple ascii file.  i'm
running NetBSD 1.3.1 i386 with XFee86 3.3.2 on a AMD K6(pentium class)
based PC. i include the aforementioned files here. anybody knowledgeable
on this please help diagnose the problem(s). if anyone uses the printer
i may be easier i you could just mail me your "/etc/printcap" and your
filter files. many thanks.

filter file:

#!/usr/bin/perl
#Filter which detects postscript files and appends cr to lines of test.
#$ID: ps-filter, v1.3 1998/07/08/09:25 Fujie Zhang $

$cat="/bin/cat"; $gs="/usr/local/bin/gs";

$_=&ltSTDIN>
if(/^%!/){
 #Pipe the file as-is to the ghostscript interpreter.
 $old_dir='pwd';
 $tmp_dir="/tmp/lp-gs.$$";
 mkdir($tmp_dir,0700);
 chdir $tmp_dir;
 open(PIPE, "|$gs -q -sDEVICE=ljet4 -sOutputFile=%03d.lj -")||die "$0:
can't run ghostscript: $!";
 print PIPE $_;
 while(&ltSTDIN>){
  print PIPE $_;
 }
 close PIPE;
 @pages=reverse(sort(<*.lj>));
 system $cat, @pages;
 unlink @pages;
 chdir $old_dir;
 rmdir $tmp_dir;
}
elsif(&isprint() && !/\r/n$/){
 #Send the text to the printer with trailing if converted to crlf.
 s/([^\r])?\n$/\l\r\n/;
 print;
 while(&ltSTDIN>){
  s/([^\r])?\n$/\l\r\n/;
  print;
  }
}
else {
 print;
 while(&ltSTDIN>)
  {print;}
 }

sub isprint{
 ($c)=split(//,$_);
 return($c=~/[\s\n]/)||(ord($c)>=32 && ord($c)<127);
}


/etc/printcap entry:

lp|lj6l|HP LaserJet6L:\
 :lo=/var/spool/lpd/lp-lock:\
 :lp=dev/lpt0:\
 :lf=/var/log/lpd-errs:\
 :of=/var/spool/ps-filter:\
 :sd=/var/spool/lpd:\
 :sh: