Subject: fs and xs printcap settings for imagewriter ii
To: None <port-mac68k@netbsd.org>
From: Douglas R. Troeger <dtroeger@ix.netcom.com>
List: port-mac68k
Date: 10/29/1999 13:34:26
Using the FreeBSD printing docs, I _almost_ have 
ghostscript 5.50 working with my imagewriter ii,
connected to an SE/30 running NetBSD 1.3.3.  Text prints 
perfectly, but postscript images are distorted:  after perhaps
a perfect inch of output, there are occasional spurious, 
dropped, and misplaced characters.   TeX output is
similarly distorted. 

My printcap file:

apple|lp|ImageWriter II:\
        :sh:\
        :sd=/var/spool/lpd/apple:\
        :lp=/dev/tty01:\
        :lf=/var/log/lpd-errs:\
        :if=/usr/pkg/libexec/if-iwlo:

And here is the filter

#!/bin/sh
#
# iwlo - Print Ghostscript-simulated Postscript on an Apple Imagewriter II
# Installed in /usr/bin/libexec/if-iwlo

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

if [ "$first_two_chars" = "%!" ]; then
        #
        # It is PostScript; use Ghostscript to scan-convert and print it
        #
        /usr/pkg/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=iwlo -sOutputFile=- - \
            && exit 0
else
        #
        # Plain text, so just print it directly; print a form
        # at the end to eject the last page
        #
        echo "$first_line" && cat && printf "\f" && exit 0
fi

exit 2



I used fs and xs in printcap to set the MDMBUF (described in 
/usr/include/sys/ioctl_compat.h), and some other flags as well,
but ... no luck.  The problem _appears_ to be due to incorrect
synchronization, but I am no expert.

Can anyone set me straight on this?


Thanks!