printing postscript files on Epson Stylus C64(xefitra)
Gerard.Moloney at gee.co.uk
Mon Apr 19 09:48:49 BST 2004
I am trying to set up a filter for this printer based on the example below
from the FreeBsd Handbook which I've changed slightly. Plain text is fine
but PostScript files just give a blank page. I'm using PostScript generated
abcm2ps and viewing fine in gs and acrobat. Also printing from emacs gives
same result; printing a postscript buffer outputs a blank page.
Am I using the correct driver?
Any help would be greatly appreciated;
Thanks Ged Moloney.
# ifhp - Print Ghostscript-simulated PostScript on a DeskJet 500
# Installed in /usr/local/libexec/ifhp
# Treat LF as CR+LF:
#printf "\033&k2G" || exit 2 //removed GM
# Read first two characters of the file
IFS="" read -r first_line
first_two_chars=`expr "$first_line" : '\(..\)'`
if [ "$first_two_chars" = "%!" ]; then
# It is PostScript; use Ghostscript to scan-convert and print it.
# Note that PostScript files are actually interpreted programs,
# and those programs are allowed to write to stdout, which will
# mess up the printed output. So, we redirect stdout to stderr
# and then make descriptor 3 go to stdout, and have Ghostscript
# write its output there. Exercise for the clever reader:
# capture the stderr output from Ghostscript and mail it back to
# the user originating the print job.
exec 3>&1 1>&2
/usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=epson \
-sOutputFile=/dev/fd/3 - && exit 0
# Plain text or HP/PCL, so just print it directly; print a form feed
# at the end to eject the last page.
echo "$first_line" && cat && printf "\033&l0H" &&
More information about the Ukfreebsd