pdfpost (2116B)
1 #!/usr/local/plan9/bin/rc 2 # convert PDF output to PostScript 3 if (! ~ $DEBUG '') flag x + 4 PATCH='%!PS 5 %%Patch from lp' 6 switch ($LPCLASS) { 7 case *hp4simx*; 8 PATCH=$PATCH' 9 %% set the default papertray to be the lower tray for HP4siMX printers 10 statusdict begin defaultpapertray end 1 ne { 11 statusdict begin 12 1 setdefaultpapertray 13 end 14 } if' 15 } 16 for (i in `{echo $IBIN|awk -F, '{ n=split($0, a, ","); for (i=1;i<=n;i++) print a[i]; }'}) { 17 switch ($i) { 18 case -P*; 19 case man manual manualfeed; 20 PATCH=$PATCH' 21 %%BeginFeature: *Select ManualFeed 22 [{ systemdict /languagelevel known {languagelevel 1 gt product (HP LaserJet 4Si) ne and} if { 23 << /ManualFeed true >> setpagedevice 24 } {statusdict begin /manualfeed true def end} ifelse 25 } stopped cleartomark 26 %%EndFeature' 27 case simplex; 28 DUPLEX=0 29 case [0-9]; 30 PATCH=$PATCH' 31 %%BeginFeature: *Select InputTray 32 [{ systemdict /languagelevel known {languagelevel 1 gt product (HP LaserJet 4Si) ne and} if { 33 << /MediaType (tray'$i') >> setpagedevice 34 } {statusdict begin '$i' setpapertray end} ifelse 35 } stopped cleartomark 36 %%EndFeature' 37 case 11x17 [Ll]edger; 38 PATCH=$PATCH' 39 %%BeginFeature: *Select Ledger 40 [{ systemdict /languagelevel known {languagelevel 1 gt product (HP LaserJet 4Si) ne and} if { 41 << /PageSize [792 1224] >> setpagedevice 42 } {statusdict begin '$i'tray end} ifelse 43 } stopped cleartomark 44 %%EndFeature' 45 case transparency vg viewgraph; 46 PATCH=$PATCH' 47 %%BeginFeature: *Select Transparency 48 [{ << /MediaType (Transparency) >> setpagedevice 49 } stopped cleartomark 50 %%EndFeature' 51 case *; 52 echo illegal option ''''-i $i'''' >[1=2] 53 } 54 } 55 if (! ~ $#DUPLEX 0) { 56 switch ($DUPLEX) { 57 case 0; 58 DUPLEX=false 59 case 1; 60 DUPLEX=true 61 } 62 PATCH=$PATCH' 63 %%BeginFeature: *Set DuplexMode 64 [{ systemdict /languagelevel known {languagelevel 1 gt product (HP LaserJet 4Si) ne and} if { 65 << /Duplex '$DUPLEX' >> setpagedevice 66 } {statusdict /setduplexmode known {statusdict begin '$DUPLEX' setduplexmode end} if} ifelse 67 } stopped cleartomark 68 %%EndFeature' 69 } 70 PATCH=$PATCH' 71 %%EndPatch from lp 72 ' 73 echo $PATCH 74 75 pdfgs $1 pswrite | $LPLIB/process/hpost 76 exit ''