Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Oct 1995 19:49:01 -0500 (CDT)
From:      Daniel Baker <dbaker@Baker.Err.COM>
To:        Sean Kelly <kelly@fsl.noaa.gov>
Cc:        questions@freebsd.org
Subject:   Re: Printing with HP Deskjet
Message-ID:  <Pine.BSF.3.91.951026194835.225C-100000@concorde-sam>
In-Reply-To: <9510262011.AA26091@emu.fsl.noaa.gov>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 26 Oct 1995, Sean Kelly wrote:

> >>>>> "Daniel" == Daniel Baker <dbaker@baker.err.com> writes:
> 
>     Daniel> I have a HP Deskjet 560c, and even after reading the
>     Daniel> handbooks, FAQs, and getting ghostscript running, I still
>     Daniel> cna't print correctly.
> 
> Send me your /etc/printcap and copies of any scripts to which it
> refers, and I'll help.

#	@(#)printcap	5.3 (Berkeley) 6/30/90

#lp|local line printer:\
#	:lp=/dev/lp:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:

deskjet:ps:PS:S:lp:HP DeskJet Printer
	:sh:sd=/var/spool/lpd/deskjet:
	:lp=/dev/lpt0:
	:if=/usr/local/libexec/hpif:
--EOF--
#!/bin/sh
#
#  ifhp - Print Ghostscript-simulated PostScript on a DesJet 500
#  Installed in /usr/local/libexec/hpif

#
#  Treat LF as CR+LF:
#
printf "\033&k2G" || exit 2

#
#  Read first two characters of the file
#
read first_line
first_two_chars=`expr "$first_line" : '\(..\)'`

if [ "$first_two_chars" = "%!" ]; then
    #
    #  It's PostScript; use Ghostscript to scan-convert and print it
    #
    /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=djet500 
-sOutputFile=- - \
        && exit 0

else
    #
    #  Plain text or HP/PCL, so just print it directly; print a form
    #  at the end to eject the last page.
    #
    echo $first_line && cat && printf "\f" && exit 2
fi

exit 2



> 
>     Daniel> Whenever I print by typing lpr filename, or doing a cat
>     Daniel> foobar.ps > /dev/lpt0, I just get three lines like this:
> 
>     Daniel> %!PS-Adobe-3.0
>     Daniel>               %%Creator: groff version 1.09
>     Daniel>                                            %%CreationDate: Thu Sep
> 
> Well, cat'ing a PostScript file to a non-PostScript printer definitely
> won't work.  Let's just work on getting Ghostscript working with LPD
> instead.
okay.....

> 
> -- 
> Sean Kelly
> NOAA Forecast Systems Laboratory, Boulder Colorado USA
> 
> I wrote a song, but I can't read music so I don't know what it is.
> Every once in a while I'll be listening to the radio and I say, "I
> think I might have written that."  -- Steven Wright
> 

Daniel Baker -- NeoSoft Student Asst. (UseNet, FTP & CivNet Admin.)
DBaker@NeoSoft.COM
DBaker@Baker.err.COM 
	** http://www.neosoft.com/neosoft/staff/dbaker/ **
		** http://www.baker.err.com/ **




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.951026194835.225C-100000>