*BSD News Article 26238


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!bunyip.cc.uq.oz.au!harbinger.cc.monash.edu.au!msuinfo!agate!usenet.ins.cwru.edu!howland.reston.ans.net!cs.utexas.edu!swrinde!sgiblab!pacbell.com!toad.com!curt
From: curt@mofo.toad.com (Curt mayer)
Newsgroups: comp.os.386bsd.questions
Subject: Re: Printer (HP LaserJet III) help! (printcap and source code)
Message-ID: <43974@toad.com>
Date: 19 Jan 94 03:42:05 GMT
References: <2hc3cc$g0i@news.ysu.edu>
Sender: news@toad.com
Distribution: world
Organization: Nebula Consultants in San Francisco
Lines: 75
Nntp-Posting-Host: mofo.toad.com

In article <2hc3cc$g0i@news.ysu.edu>, ap713@yfn.ysu.edu (Christopher L. Mikkelson) writes:
|> 
|> I have had troubles getting an HP Ljet 3 working under FreeBSD-1.0R.
|> When I print, everything comes out with no CRs.  Is anybody else using
|> an Ljet3 under FreeBSD?  If you are, please send me your printcap and,
|> if any, filters.  BTW, my printer is on lpa0 (not serial).
|> 
|> Thanks in advance,
|> -Chris Mikkelson
|> -- 

this comes up over and over again. is there a printer FAQ?
anyway, heree it goes again:

my printcap:

ps|postscript emulation:\
        :lp=/dev/lpa0:sd=/var/spool/lpd:lf=/var/log/lpd-errs:\
        :if=/usr/libexec/lpr/ps2lj3:sh:mx#0:sf:

lp|epson|lj|local line printer:\
        :lp=/dev/lpa0:sd=/var/spool/lpd:lf=/var/log/lpd-errs:\
        :if=/usr/libexec/lpr/hpf:\
        :sh:mx#0:pw#80:

my /usr/libexec/lpr/ps2lj3:

#!/bin/sh
/usr/gnu/bin/gs -dNOPAUSE -r300 -q -sDEVICE=ljet3 -sOutputFile=- -f -

source to my hp filter, installed as /usr/libexec/lpr/hpf:

#include "stdio.h"
#include <signal.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sgtty.h> 

main(ac, av)
int ac;
char **av;
{
        int c;
        struct sgttyb nbuf;
        unsigned long lbits;

        setbuf(stdout, NULL);
        lbits = LDECCTQ | LPASS8 | LLITOUT;
        ioctl(fileno(stdout), TIOCLSET, &lbits);
        ioctl(fileno(stdout), TIOCGETP, &nbuf);
        nbuf.sg_flags &= ~(ECHO | XTABS | CRMOD);
        ioctl(fileno(stdout), TIOCSETP, &nbuf);

        fputs("\033E\033&k2G", stdout);

        while (1) {
                if ((c = getchar()) != EOF) {
                        putchar(c);
                } else {
                        break;
                }
        }

        fputs("\033&l0H", stdout);

        exit(0);
}

there's more, including a sun rasterfile filter, and an enscript replacement.
write me if you want them.

-- 
	curt mayer
        curt@toad.com
        415-387-0217 home