#!/bin/sh # (c) Alexander Leidinger # BSD style license # # psif - Print Ghostscript-simulated PostScript on a DeskJet 890c or compatible # Installed in /usr/local/libexec/lpd/psif # read first_line first_two_chars=`expr "$first_line" : '\(..\)'` export GS_LIB=/usr/X11R6/lib/X11/fonts/PD_Deco:/usr/X11R6/lib/X11/fonts/PD_Sans:/usr/X11R6/lib/X11/fonts/PD_Script:/usr/X11R6/lib/X11/fonts/PD_Serif:/usr/X11R6/lib/X11/fonts/PD_Symb:/usr/X11R6/lib/X11/fonts/PGS_Serials:/usr/X11R6/lib/X11/fonts/PGS_Studio:/usr/X11R6/lib/X11/fonts/freefont:/usr/X11R6/lib/X11/fonts/sharefont if [ "$first_two_chars" = "%!" ]; then # # It is Postscript; use Ghostscript to scan-convert and print it # /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=hpdj890c -sOutputFile=- - \ && exit 0 # /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=ljet4 -sOutputFile=- - \ # && exit 0 else # # 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 "\f" && exit 0 fi exit 2