From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078654410978.tru64-unix-managers.marc@archive.invalid> From: Chester Liu Date: Thu, 22 Jan 1998 15:21:47 +0000 To: tru64-unix-managers Subject: SUMMARY: using Ghostscript as print filter X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078654410978 Hello, it's time to summarize the helpful responses I got. My basic question was how do I use ghostscript as a print filter and how do I configure /etc/printcap and write a filter script. I'm running DU 4.0B, Ghostscript 5.10, and Epson Stylus Pro. (I also discuss compiling Ghostscript 5.10 successfully on DU 4.0) 2 people helped me out; what follows are their solutions and my final result. ------------------------------ Tom Leitner tom@finwal01.tu-graz.ac.at had this suggestion: Here's my solution for using ghostscript as a print filter. Works like a charm: # # HP Laserjet 5L, Zimmer 41 mit Postscript Filter # lpgs|ps:\ :af=/var/adm/lplog/lpgs.acct:\ :lf=/var/adm/lplog/lpgs.err:\ :lp=/dev/lp0:\ :sh:\ :of=/usr/local/bin/gsfilter:\ :sd=/usr/spool/lpgs: $ cat /usr/local/bin/gsfilter #!/bin/sh device=ljet4 res=600 #ff=/tmp/gs$$.fifo CMD_ENV=bsd; export CMD_ENV trap 'rm $ff; exit 1' 1 2 3 4 # # reset laserjet with ESC-E # /usr/bin/echo -n \\033\\0105 # # call gs # /usr/local/bin/gs -q -dNOPAUSE -sDEVICE=$device -r$res \ -sPAPERSIZE=a4 -sOutputFile=- - #cat $ff #rm $ff exit 0 Note that you can't use print filters for remote printers! For remote printers, you'd need to define a printer with lp=/dev/null and modify the gsfilter script to write the output to the desired physical printer queue. --------- Dejan Muhamedagic dejan@yunix.com had this solution: This is the filter which works for out hp running pcl: #!/bin/sh /usr/local/bin/gs -q -dNOPAUSE -sPAPERSIZE=a4 -sDEVICE=ljet3 \ -sOutputFile=- - # EOF and this is the printcap entry: # lp2|2|pshp|hpps|ps2pcl:\ :lf=/usr/adm/lp2err:\ :sd=/usr/spool/lpd2:\ :lp=/dev/lp0:\ :mx#0:\ :sh:\ :if=/usr/lbin/ps2pcl: # ----------------------------------------------- this is my solution: /etc/printcap: color|stylus|colorthru:\ :if=/usr/spool/printer/lpcolor:\ :lf=/usr/adm/lperr:\ :lp=/dev/lp0:\ :mx#0:\ :sh:\ :sd=/usr/spool/lpd/color: and in my /usr/spool/printer/lpcolor: #! /bin/sh /usr/local/bin/gs -sDEVICE=stcolor -dSoftweave -sOutputFile=- \ -dNOPAUSE -dQUIET -dSHORTERRORS -quiet -sDithering="fscmyk" \ stcolor.ps - The important thing is the -sOutputFile=- which tells it to pipe out and the - at the end which tells it to take input from the pipe as well. Incidentally, I had a lot of trouble compiling Ghostscript 5.10 with the unix-cc.mak makefile. It generated errors trying to compile one of the PDF-related files. So, I just disabled anything pdf-related stuff in the makefile and now it works like a charm! Be sure to read Fontmap.OSF before you start. The output on the Epson Stylus is beautiful and ghostscript on an Alpha is orders of magnitude faster than Epson drivers on Windows or Macs!!!! :) Chester Liu cht@rati.pse.umass.edu