[OLUG] Speaking of printing problems...

Dave Burchell burchell at inetnebr.com
Fri Jan 7 17:41:32 UTC 2000


Tim Russell says:

> Last night I set up a server for a client who has a Laserjet 4 with a
> Jetdirect card (and no Postscript).  I used printtool to install it, told it
> it was a Laserjet 3/4/5 and to fix text-stairstepping.  Now, it prints fine,
> except it prints the same page over and over and over again when I print a
> test page (or anything else).

What if you print plain text, such as "date | lpr -Plj4"?  Does it print
that endlessly?

Try setting up another printcap entry that uses no filter.  This works for
me; I think the "rp=LPT1_PASSTHRU" is right but your Jetdirect card could
need a different name.

hp8000: \
    :lp=:rm=165.83.168.17:rp=LPT1_PASSTHRU:sh:sd=/var/spool/lpd/hp8000: \
    :mx#0: \
    :lf=/var/spool/lpd/hp8000/errs:

How does printing filterlessly in this way work?

> I tried debugging that monster of a print filter, but that was just too much
> to take on - anybody seen this?

Why not write your own printer filter in Perl?  Here is one I use; you
could write a better one:

#!/usr/bin/perl
$tempbase = "/tmp/pp_$$";
open (TMP, ">$tempbase") || die "Could not open $tempbase\n";
while ($blah = <STDIN>) {
        $blah =~ s/\n/\r\n/;
        print(TMP "$blah");
}
print(TMP "\x0C");
close TMP;
`lpr -Php8000 $tempbase`;
`rm $tempbase`;

Note that I call lpr from my print filter and print the filtered temp
file to the plain (unfiltered) printcap entry.

(BTW, creating a temporary file as I do seems inelegant; anyone know a
cleaner way?)

Here is the /etc/printcap entry that uses this Perl filter program:

hp8: \
    :lp=/dev/null:sd=/var/spool/lpd/hp8:sh: \
    :mx#0:\
    :if=/var/spool/lpd/hp8/input_filter:lf=/var/spool/lpd/hp8/errs:

-- 
Dave Burchell                                          40.49'N, 96.41'W
Free your mind and your software will follow.              402-467-1619
http://incolor.inetnebr.com/burchell/                  burchell at acm.org     

-------------------------------------------------------------------------
Sent by OLUG Mailing list Manager, run by ezmlm.  http://olug.bstc.net/ 
To unsubscribe: `echo unsubsribe | mail olug-unsubscribe at bstc.net` 



More information about the OLUG mailing list