/usr/bin/foo2zjs-pstops is in printer-driver-foo2zjs 20111202dfsg0-1ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | #!/bin/sh
VERSION='$Id: foo2zjs-pstops.sh,v 1.17 2011/11/23 22:07:33 rick Exp $'
PROGNAME="$0"
usage() {
cat <<EOF
NAME
`basename $PROGNAME` - Add PS code for foo2*-wrapper
SYNOPSIS
`basename $PROGNAME` [options] [file]
DESCRIPTION
Add PS code for foo2zjs-wrapper.
OPTIONS
-h ydimpts For rotate -r, y dimension points
-r Rotate 90 clockwise
-a Accurate Screens code
-c CIEColor
-n Neuter CUPS cupsPSLevel2
-w Well Tempered Screens code
-D lvl Debug level
EOF
exit 1
}
#
# Report an error and exit
#
error() {
echo "`basename $PROGNAME`: $1" >&2
exit 1
}
debug() {
if [ $DEBUG -ge $1 ]; then
echo "`basename $PROGNAME`: $2" >&2
fi
}
#
# Use gsed instead of sed on Mac OSX
#
case `uname -s` in
Darwin) sed=gsed;;
*) sed=sed;;
esac
#
# Process the options
#
DEBUG=0
ROTATE90=0
ACCURATE=0
CIECOLOR=0
NIXCUPS=0
WTS=0
while getopts "ach:nwrD:Vh?" opt
do
case $opt in
a) ACCURATE=1;;
c) CIECOLOR=1;;
h) YDIMpoints="$OPTARG";;
n) NIXCUPS=1;;
r) ROTATE90=1;;
w) WTS=1;;
D) DEBUG="$OPTARG";;
V) echo "$VERSION"; exit 0;;
h|\?) usage;;
esac
done
shift `expr $OPTIND - 1`
if [ $NIXCUPS = 1 ]; then
n='s#^[^/]*cupsPSLevel2#false#'
else
n=
fi
if [ $ROTATE90 = 1 ]; then
# %%currentpagedevice /PageSize get\
# %%aload pop translate\
r="1i\
<< /Install {\
0 $YDIMpoints translate\
-90 rotate\
} >> setpagedevice
"
else
r=
fi
if [ $WTS = 1 ]; then
w='/%%Page:[ ]*[ (]1[ )].*$/ i\
<< /UseWTS true >> setuserparams \
<<\
/AccurateScreens true\
/HalftoneType 1\
/HalftoneName (Round Dot Screen) cvn\
/SpotFunction { 180 mul cos exch 180 mul cos add 2 div}\
/Frequency 137\
/Angle 37\
>> sethalftone
'
elif [ $ACCURATE = 1 ]; then
w='/%%Page:[ ]*[ (]1[ )].*$/ i\
<< /UseWTS false >> setuserparams \
<<\
/AccurateScreens true\
/HalftoneType 1\
/HalftoneName (Round Dot Screen) cvn\
/SpotFunction { 180 mul cos exch 180 mul cos add 2 div}\
/Frequency 137\
/Angle 37\
>> sethalftone
'
else
w=
fi
#
# Main Program
#
$sed \
-e "$w" \
-e "$n" \
-e "$r" \
$@
|