Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Apr 1997 08:40:43 +0200 (MET DST)
From:      Christoph Kukulies <kuku@gilberto.physik.rwth-aachen.de>
To:        cadams@erols.com (Chris)
Cc:        questions@freebsd.org
Subject:   Re: Printing
Message-ID:  <199704160640.IAA07161@gilberto.physik.rwth-aachen.de>
In-Reply-To: <3354474B.80E@erols.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> I can print plain text, but what do I need to do in order to print stuff
> from my browser (Netscape 3.1) or any other application I may be running
> under FreeBSD.  My printer is an HP Deskjet 500.  Thanks.

1. Install ghostscript 4.03
2. Create a /etc/printcap entry a la:

lps|lp-postscript|hp ljet III + PostScript filter :\
        :lp=/dev/lpt0:\
        :sd=/var/spool/output/lps:\
        :sh:\
        :if=/usr/local/bin/lpf:\
        :lf=/var/log/lpd-errs:\        


3. get lprps (from comp.unix.sources) or just use this kind of
   filter:

   /usr/local/bin/lpf:

#!/bin/sh
#  psif - Print PostScript or plain text on a PostScript printer
#  Script version; NOT the version that comes with lprps
#  Installed in /usr/local/libexec/psif
#
PRINT_DEV=cdj500
read first_line
first_two_chars=`expr "$first_line" : '\(..\)'`

if [ "$first_two_chars" = "%!" ]; then
   #
   #  PostScript job, print it.
   #
   ( echo $first_line ;  cat ) | \
/usr/local/bin/gs -dSAFER -dNOPAUSE -sDEVICE=$PRINT_DEV -sOutputFile=- -q -
else
   #
   #  Plain text, convert it, then print it.
   #
 ( echo $first_line; cat ) | /usr/local/bin/textps | \
/usr/local/bin/gs -dSAFER -dNOPAUSE -sDEVICE=$PRINT_DEV -sOutputFile=- -q -
fi
exit 0                                                        


4. type 
          gs -help
   and lookup your printer in the list of supported devices.
   If it's not in there build the ghostscript4.03 port
   again and select the desired devices (or just edit the Makefile)

Or just read the handbook chapter on printing.

> 

--
Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704160640.IAA07161>