Newbie lpd printing

Gary Schenk gwschenk at
Thu Apr 10 21:45:21 PDT 2003

This FreeBSD newbie has even learned  how to print! I'm using lpd to print and  
it works fine from the console. I'm using an old Epson with the hpif 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 results I get in 
KDE seem to indicate that the input filter is not working. Does 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, choose lpd, and 

I'm not good at scripts yet, so maybe that is the problem? Here is my input 
filter file:


# 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="" read -r first_line
first_two_chars=`expr "$first_line" : '\(..\)'`

if [ "$first_two_chars" = "%!" ]; then

        exec 3>&1 1>&2
        /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=uniprint \
                -sOutputFile=/dev/fd/3 - && exit 0

        /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=uniprint \ 
                -sOutputFile=- - && exit 0

                echo "$first_line" && cat && printf "\033&10H" &&
        exit 0

        exit 2

Gary Schenk

More information about the freebsd-questions mailing list