Date: Fri, 27 Jan 1995 10:47:12 +0100 From: Lars Koeller <uphya001@odie.physik2.uni-rostock.de> To: freebsd-questions@freefall.cdrom.com Cc: uphya001@odie.physik2.uni-rostock.de Subject: Solution for filtering and remote printing on a network printer! Message-ID: <199501270947.KAA06332@odie.physik2.uni-rostock.de>
next in thread | raw e-mail | index | archive | help
I notice some time ago some questions about printing with filtering on a remote network printer. I worked out a solution with the well known and fairly good apsfilter-4.8.1 (aps-481.tgz on ftp.Germany.EU.net in pub/os/Linux/Local.EUnet/People/akl). I do a requing with the normal lpr command in apsfilter. lpq and lprm are very simple scripts which access the remote printer by default. The original binaries are renamed to olpq and olprm. Here are the diffs, my sample lprm, lpq, printcap and apsfilterrc files for a PostScript LaserJet IV with a JetDirect network card. Please send me any suggestions fixes or problems. I hope it will work well with your setup too! Regards Lars ------------------------------------------------------------------------------ Lars Köller E-Mail: University of Rostock (Germany) lars.koeller@odie.physik2.Uni-Rostock.DE Fachbereich Physik lars.koeller@physik.Uni-Rostock.DE Universitätsplatz 3 Phone: +49 381/498-1665 or 498-1648 18051 Rostock Fax: +49 381/498-1667 ### lprm ### . /etc/apsfilterrc /usr/bin/olprm -P$REMOTE_PRINTER $* ### lpq ### . /etc/apsfilterrc /usr/bin/olpq -P$REMOTE_PRINTER $* ### /etc/printcap ### ####### @(#)printcap 5.3 (Berkeley) 6/30/90 ####### ####### # LABEL apsfilter # apsfilter setup Tue Dec 13 18:50:27 MET 1994 # # APS_BASEDIR:/usr/local/lib/apsfilter # # # lj4.remote|enables remote printing with apsfilter:\ :rm=lj4.physik2.uni-rostock.de:\ :sd=/var/spool/PS_600dpi-raw:\ :lf=/var/spool/PS_600dpi-raw/log:\ :af=/var/spool/PS_600dpi-raw/acct:\ :mx#0: # ascii|PS_600dpi-a4-ascii-mono|PS_600dpi ascii mono:\ :lp=/dev/null:\ :sd=/var/spool/PS_600dpi-a4-ascii-mono:\ :lf=/var/spool/PS_600dpi-a4-ascii-mono/log:\ :af=/var/spool/PS_600dpi-a4-ascii-mono/acct:\ :if=/usr/local/lib/apsfilter/filter/aps-PS_600dpi-a4-ascii-mono:\ :mx#0:\ :rg=lp: # raw|PS_600dpi-a4-raw|PS_600dpi auto raw:\ :lp=/dev/null:\ :sd=/var/spool/PS_600dpi-raw:\ :lf=/var/spool/PS_600dpi-raw/log:\ :af=/var/spool/PS_600dpi-raw/acct:\ :if=/usr/local/lib/apsfilter/filter/aps-PS_600dpi-a4-raw:\ :mx#0:\ :rg=lp: # lp|PS_600dpi-a4-auto-mono|PS_600dpi auto mono:\ :lp=/dev/null:\ :sd=/var/spool/PS_600dpi-a4-auto-mono:\ :lf=/var/spool/PS_600dpi-a4-auto-mono/log:\ :af=/var/spool/PS_600dpi-a4-auto-mono/acct:\ :if=/usr/local/lib/apsfilter/filter/aps-PS_600dpi-a4-auto-mono:\ :mx#0:\ :rg=lp: ### diffs for apsfilter in .../apsfilter/bin/apsfilter; Version 4.8.1 ### *** apsfilter.orig Tue Dec 13 19:10:41 1994 --- apsfilter Fri Jan 27 10:26:28 1995 *************** *** 331,349 **** case $PRINTER in ! PS_*dpi) # our printer is a PS printer... ! PRINT_PS="cat -" ;; *) # we have a nice non ps printer ! PRINT_PS=" gs \ ! -q \ ! -sDEVICE=${PRINTER} \ ! -r${GS_RESOL} \ ! -sPAPERSIZE=${PAPERSIZE} \ ! -dNOPAUSE \ ! -dSAFER \ ! -sOutputFile=- \ ! - " ;; esac if [ "$PRINT_TO_FILE" = "True" ]; then --- 331,369 ---- case $PRINTER in ! PS_*dpi) # our printer is a PS printer... ! if [ "$REMOTE_PRINTER" != "" ]; then ! PRINT_PS="/usr/bin/lpr -U ${LOGINNAME} -P${REMOTE_PRINTER} -h" ! else ! PRINT_PS="cat -" ! fi ;; *) # we have a nice non ps printer ! if [ "$REMOTE_PRINTER" != "" ]; then ! PRINT_PS=" gs \ ! -q \ ! -sDEVICE=${PRINTER} \ ! -r${GS_RESOL} \ ! -sPAPERSIZE=${PAPERSIZE}\ ! -dNOPAUSE \ ! -dSAFER \ ! -sOutputFile=- \ ! - | /usr/bin/lpr \ ! -U ${LOGINNAME} \ ! -P${REMOTE_PRINTER} \ ! -h" ! else ! PRINT_PS=" gs \ ! -q \ ! -sDEVICE=${PRINTER} \ ! -r${GS_RESOL} \ ! -sPAPERSIZE=${PAPERSIZE}\ ! -dNOPAUSE \ ! -dSAFER \ ! -sOutputFile=- \ ! - " ! fi ;; ! esac if [ "$PRINT_TO_FILE" = "True" ]; then *************** *** 408,414 **** print_sunraster() { ! $DECOMPRESS ras2ps $RAS2PS_OPTS | $PRINT_PS } print_sunraster2() --- 428,434 ---- print_sunraster() { ! $DECOMPRESS ras2ps $RAS2PS_OPTS | eval $PRINT_PS } print_sunraster2() *************** *** 495,501 **** printf $PRINT_RAW_SETUP_PRINTER fi ! $DECOMPRESS cat - # usually we do a nice formfeed if [ ! $PRINT_RAW_SUPPRESS_FORMFEED ]; then --- 515,522 ---- printf $PRINT_RAW_SETUP_PRINTER fi ! $DECOMPRESS eval "/usr/bin/lpr -U ${LOGINNAME} -P${REMOTE_PRINTER} -h" ! # cat - # usually we do a nice formfeed if [ ! $PRINT_RAW_SUPPRESS_FORMFEED ]; then *************** *** 556,567 **** if [ ! $A2PS_OPTS ]; then # not user defined A2PS_OPTS="${A2PS_BASIC_OPTIONS} \ ! ${A2PS_STD_OPTIONS} \ ${A2PS_FEATURES}" else # user defined, but keep BASIC options A2PS_OPTS="${A2PS_BASIC_OPTIONS} \ ! ${A2PS_OPTS}" fi case $PRINTER in --- 577,589 ---- if [ ! $A2PS_OPTS ]; then # not user defined A2PS_OPTS="${A2PS_BASIC_OPTIONS} \ ! ${A2PS_STD_OPTS} \ ${A2PS_FEATURES}" else # user defined, but keep BASIC options A2PS_OPTS="${A2PS_BASIC_OPTIONS} \ ! ${A2PS_OPTS} \ ! ${A2PS_FEATURES}" fi case $PRINTER in *************** *** 619,625 **** *) # it's not compressed ! DECOMPRESS="";; esac - $DECOMPRESS a2ps ${A2PS_OPTS} | eval $PRINT_PS } --- 641,646 ---- *************** *** 632,638 **** print_data() { ! $DECOMPRESS cat - } --- 653,660 ---- print_data() { ! $DECOMPRESS eval "/usr/bin/lpr -U ${LOGINNAME} -P${REMOTE_PRINTER} -h" ! # cat - } *************** *** 884,889 **** --- 906,916 ---- fault_filetype fi ;; + data | *escape*) + # that's certainly not critical, + # you're on your own ;-) + print_data ;; + *ascii*|*text*|*english*|*script*) if [ "$HAVE_A2PS" = "True" \ -a "$HAVE_GS" = "True" ]; then *************** *** 891,901 **** else fault_filetype fi ;; - data) - # that's certainly not critical, - # you're on your own ;-) - print_data ;; - *) # data we - I'm so sorry - don't know fault_filetype ;; --- 918,923 ----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199501270947.KAA06332>