*BSD News Article 34326


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!pipex!sunic!trane.uninett.no!eunet.no!nuug!EU.net!uunet!zib-berlin.de!rs1-hrz.uni-duisburg.de!rrz.uni-koeln.de!RRZ.Uni-Koeln.DE!RRZ.Uni-Koeln.DE!news
From: se@fileserv1.MI.Uni-Koeln.DE (Stefan Esser)
Newsgroups: comp.os.386bsd.questions
Subject: Re: Printing under FreeBSD 1.5.1.1
Date: 14 Aug 1994 22:45:04 GMT
Organization: Institute of Nuclear Physics, University of Cologne, Germany
Lines: 57
Distribution: world
Message-ID: <32m6pgINN2srs@rs1.rrz.Uni-Koeln.DE>
References: <32hijhINNgab@gambier.ugrad.cs.ubc.ca> <32jd85$rct@agate.berkeley.edu>
NNTP-Posting-Host: fileserv1.mi.uni-koeln.de

In article <32jd85$rct@agate.berkeley.edu>, tmonroe@soda.CSUA.Berkeley.EDU () writes:
|> You can probably tell from this that printing under any BSD-derived OS
|> is going to be a pain.  Ask me, I know.  My printer, an HP DeskJet
|> 500, won't work properly at all so I have given up on trying to print
|> under BSD.  If I could somehow change LF to CR-LF, it MIGHT actually
|> work right when I cat > /dev/lpt0.  Now, when it gets to the 80th

That's simple !

All you need to do is send the  following sequence to your printer 
at the beginning of each print job: "\033&k2G".
It works with all Laserjet Printers since at least the Laserjet 1+ 
and with all other HP-PCL printers (ie. Deskjet, newer Paintjet) ...

We do this with the following output filter (install mode 0755):

-- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --
#!/bin/sh
########################################################################
# Output Filter for HP PCL Printer
#

# reset plotter, select LF->CRLF mode
INIT="\033E\033&k2G\c"

# reset plotter
UNINIT="\033E\c"

echo -e $INIT
cat
echo -e $UNINIT

# signal success
exit 0
-- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --

This filter gets invoked by adding the following 'printcap' entries:

        :if=/vol/local/lib/lpdfilters/HP-PCL:\
        :sh:\
        :tr=:

This allows sending an unmodified data stream to the printer (ie. no
LF->CRLF substitution in the output filter, which would corrupt binary 
data (graphics) and fonts).

|> column, it gets confused and stops.  Maybe I should go back to a daisy
|> wheel...

No, definitely not ...

-- 
 Stefan Esser				Internet:	<se@MI.Uni-Koeln.DE>
 Mathematisches Institut		Tel:		+49 221 4706010
 Universitaet zu Koeln			FAX:		+49 221 4705160
 Weyertal 80
 50931 Koeln