testpost 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/rc
  2. if (! ~ $DEBUG '') flag x +
  3. PATCH='%%Patch from lp'
  4. switch ($LPCLASS) {
  5. case *hp4simx*;
  6. PATCH=$PATCH'
  7. %% set the default papertray to be the lower tray for HP4siMX printers
  8. statusdict begin defaultpapertray end 1 ne {
  9. statusdict begin
  10. 1 setdefaultpapertray
  11. end
  12. } if'
  13. }
  14. for (i in `{echo $IBIN|awk -F, '{ n=split($0, a, ","); for (i=1;i<=n;i++) print a[i]; }'}) {
  15. switch ($i) {
  16. case -P*;
  17. case man manual manualfeed;
  18. PATCH=$PATCH'
  19. %%BeginFeature: *Select InputSlot
  20. [{
  21. systemdict /languagelevel known {languagelevel 1 gt product (HP LaserJet 4Si) ne and} if {
  22. (<<) cvx exec
  23. /ManualFeed true
  24. (>>) cvx exec setpagedevice
  25. } {statusdict begin /manualfeed true def end} ifelse
  26. } stopped cleartomark
  27. %%EndFeature'
  28. case simplex;
  29. DUPLEX=0
  30. case [0-9];
  31. PATCH=$PATCH'
  32. %%BeginFeature: *Select InputSlot
  33. [{
  34. systemdict /languagelevel known {languagelevel 1 gt product (HP LaserJet 4Si) ne and} if {
  35. << '$i' << /MediaType (tray'$i') >> >>
  36. << /MediaType (tray'$i') >> setpagedevice
  37. } {statusdict begin '$i' setpapertray end} ifelse
  38. } stopped cleartomark
  39. %%EndFeature'
  40. case 11x17 ledger;
  41. PATCH=$PATCH'
  42. %%BeginFeature: *Select InputMedia
  43. [{
  44. systemdict /languagelevel known {languagelevel 1 gt product (HP LaserJet 4Si) ne and} if {
  45. (<<) cvx exec
  46. /MediaType '$i'
  47. (>>) cvx exec setpagedevice
  48. } {statusdict begin '$i'tray end} ifelse
  49. } stopped cleartomark
  50. %%EndFeature'
  51. case *;
  52. echo illegal option ''''-i $i'''' ignored >[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; cat