#!/bin/bash # # gspdftops # # a bone-stupid wrapper around ps2pdf from Ghostscript to allow CUPS to # use that instead of its own apparently broken pdftops (based on xpdf's) # # this seems to work well enough, at least OS X can print now to a CUPS # printer. use at your own risk. # # it's completely trivial, but I've been asked before, so the license # is BSD. deal with it. GS="/usr/bin/gs" PDF2PS="/usr/bin/pdf2ps" PDF2PS_OPTIONS="-dPrinted" # die if gs and ps2pdf aren't available if [ ! -x "$GS" ] || [ ! -x "$PDF2PS" ]; then exit 1 ; fi # the filter doesn't actually use any of these, but... JOBID=$1 USERNAME=$2 TITLE=$3 COPIES=$4 OPTIONS=$5 PDFFILE=$6 #echo $JOBID #echo $USERNAME #echo $TITLE #echo $COPIES #echo $OPTIONS #echo $PDFFILE # simple test... we didn't get six parameters, we die non-zero-ally if [ "$PDFFILE" == "" ]; then echo Not enough parameters ; exit 1 ; fi # ok, convert the file, send it to stdout like the real filter does $PDF2PS $PDF2PS_OPTIONS $PDFFILE -