1
0

cropmarks 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/rc
  2. # Center pages and put cropmarks at each corner. Physical page size
  3. # is set with -w and -h. The default is 8.5 by 11.0 inches. Device
  4. # dependent code to change paper size (e.g. with setpageparams) goes
  5. # in the prologue. You may need to customize the device dependent
  6. # code that we distribute. By default it only supports variable page
  7. # sizes on Linotronic typesetters, and assumes those typesetters are
  8. # using 12 inch wide paper. Use -d to disable execution of device
  9. # dependent PostScript code.
  10. #
  11. # What's here was written quickly and will likely be very different
  12. # in our next release. It should be part of a more general program!!
  13. #
  14. POSTLIB=/sys/lib/postscript/prologues
  15. PROLOGUE=$POSTLIB/cropmarks.ps
  16. EXPANDPAGE=true
  17. PAGEWIDTH=8.5
  18. PAGEHEIGHT=11.0
  19. SCALETOFIT=false
  20. XOFFSET=0.0
  21. YOFFSET=0.0
  22. NONCONFORMING=%!PS
  23. ENDPROLOG=%%EndProlog
  24. BEGINSETUP=%%BeginSetup
  25. ENDSETUP=%%EndSetup
  26. while (! ~ $#* 0 && ~ $1 -*) {
  27. switch ($1) {
  28. case -d; EXPANDPAGE=false
  29. case -h; shift; PAGEHEIGHT=$1
  30. case -h*; PAGEHEIGHT=`{echo $1 | sed s/-h//}
  31. case -s; SCALETOFIT=true
  32. case -w; shift; PAGEWIDTH=$1
  33. case -w*; PAGEWIDTH=`{echo $1 | sed s/-w//}
  34. case -x; shift; XOFFSET=$1
  35. case -x*; XOFFSET=`{echo $1 | sed s/-x//}
  36. case -y; shift; YOFFSET=$1
  37. case -y*; YOFFSET=`{echo $1 | sed s/-y//}
  38. case -L; shift; PROLOGUE=$1
  39. case -L*; PROLOGUE=`{echo $1 | sed s/-L//}
  40. case --;
  41. case -*; echo '$0: illegal option $1' >[1=2]; exit 1
  42. }
  43. shift
  44. }
  45. echo $NONCONFORMING
  46. cat $PROLOGUE
  47. echo $ENDPROLOG
  48. echo $BEGINSETUP
  49. echo 'CropmarkDict begin'
  50. echo '/pageheight '$PAGEHEIGHT' def'
  51. echo '/pagewidth '$PAGEWIDTH' def'
  52. echo '/expandpage '$EXPANDPAGE' def'
  53. echo '/scaletofit '$SCALETOFIT' def'
  54. echo '/xoffset '$XOFFSET' def'
  55. echo '/yoffset '$YOFFSET' def'
  56. echo 'setup'
  57. echo 'end'
  58. echo $ENDSETUP
  59. cat $*