Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Apr 2003 15:19:45 +0930
From:      Malcolm Kay <Malcolm.Kay@internode.on.net>
To:        "Gar/usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=uniprint  > -sOutputFile=- - && exit 0y Schenk" <gwschenk@socal.rr.com>, freebsd-questions@freebsd.org
Subject:   Re: Newbie lpd printing
Message-ID:  <200304121519.45544.Malcolm.Kay@internode.on.net>
In-Reply-To: <200304102145.25225.gwschenk@socal.rr.com>
References:  <200304102145.25225.gwschenk@socal.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 11 Apr 2003 14:15, Gary Schenk wrote:
> This FreeBSD newbie has even learned  how to print! I'm using lpd to pr=
int
> and it works fine from the console. I'm using an old Epson with the hpi=
f
> filter from the FreeBSD handbook, using uniprint as the device.
>
> However, it does not work in KDE. I've read the KDE printing handbook, =
but
> have not found much there.
>
> It seems to be an input filter problem. My /etc/printcap file calls on
> hpif, which does print text  files to the Epson just fine, yet the resu=
lts
> I get in KDE seem to indicate that the input filter is not working. Doe=
s
> KDE use /etc/printcap?  Have I missed something in setting up printing =
for
> KDE? Basically all I've done is click "print" in the application, choos=
e
> lpd, and ok.
>
> I'm not good at scripts yet, so maybe that is the problem? Here is my i=
nput
> filter file:
>
> #!/bin/sh
>
> # Treat LF as CR+LF
>
> printf "\033&k2g" || exit 2
>
> # Now read first two characters of the file to determine if PostScript =
or
> not # and apply the appropiate massaging
>
> IFS=3D"" read -r first_line
> first_two_chars=3D`expr "$first_line" : '\(..\)'`
>
> if [ "$first_two_chars" =3D "%!" ]; then
>
>         exec 3>&1 1>&2
>         /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=3Duniprint \
>                 -sOutputFile=3D/dev/fd/3 - && exit 0
>
> #
>         /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=3Duniprint \
>                 -sOutputFile=3D- - && exit 0
>
>         else
>                 echo "$first_line" && cat && printf "\033&10H" &&
>         exit 0
>         fi
>
>         exit 2
>

The parameters given to gs here are quite insufficient; ghostscript needs=
 a=20
number of parameters specific to the particular printer model to be proce=
ssed
through the uniprint device.

The norm is to supply these in a file (*.upp) selected from the ghostscri=
pt=20
library (/usr/local/share/ghostscript/x.xx/lib) to match your particular=20
printer model. This is referenced as say:

=09/usr/local/bin/gs @stc.upp -q -sOutputFile=3D- - && exit 0

where stc.upp is the lbrary file matching your printer. -dSAFER; -dNOPAUS=
E
and -sDEVICE=3Duniprint are normally setup in the *.upp file.

An alternative, which I use for an Epson C80 with gnu ghostscript, is the=
 stp=20
device. Have a look at /usr/local/share/ghostscript/x.xx/gimp-print/READM=
E.
(I don't think stp is directly available in the Aladdin ghostscript=20
distribution)

Malcolm Kay



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