]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/postscript/cropmarks/cropmarks.rc
delete old NOTICE file
[plan9front.git] / sys / src / cmd / postscript / cropmarks / cropmarks.rc
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
15 POSTLIB=/sys/lib/postscript/prologues
16 PROLOGUE=$POSTLIB/cropmarks.ps
17
18 EXPANDPAGE=true
19 PAGEWIDTH=8.5
20 PAGEHEIGHT=11.0
21 SCALETOFIT=false
22 XOFFSET=0.0
23 YOFFSET=0.0
24
25 NONCONFORMING=%!PS
26 ENDPROLOG=%%EndProlog
27 BEGINSETUP=%%BeginSetup
28 ENDSETUP=%%EndSetup
29
30 while (! ~ $#* 0 && ~ $1 -*) {
31         switch ($1) {
32         case -d;  EXPANDPAGE=false
33
34         case -h;  shift; PAGEHEIGHT=$1
35         case -h*; PAGEHEIGHT=`{echo $1 | sed s/-h//}
36
37         case -s;  SCALETOFIT=true
38
39         case -w;  shift; PAGEWIDTH=$1
40         case -w*; PAGEWIDTH=`{echo $1 | sed s/-w//}
41
42         case -x;  shift; XOFFSET=$1
43         case -x*; XOFFSET=`{echo $1 | sed s/-x//}
44
45         case -y;  shift; YOFFSET=$1
46         case -y*; YOFFSET=`{echo $1 | sed s/-y//}
47
48         case -L;  shift; PROLOGUE=$1
49         case -L*; PROLOGUE=`{echo $1 | sed s/-L//}
50
51         case --;
52
53         case -*;  echo '$0: illegal option $1' >[1=2]; exit 1
54
55         }
56         shift
57 }
58
59 echo $NONCONFORMING
60 cat $PROLOGUE
61 echo $ENDPROLOG
62 echo $BEGINSETUP
63 echo 'CropmarkDict begin'
64 echo '/pageheight '$PAGEHEIGHT' def'
65 echo '/pagewidth '$PAGEWIDTH' def'
66 echo '/expandpage '$EXPANDPAGE' def'
67 echo '/scaletofit '$SCALETOFIT' def'
68 echo '/xoffset '$XOFFSET' def'
69 echo '/yoffset '$YOFFSET' def'
70 echo 'setup'
71 echo 'end'
72 echo $ENDSETUP
73
74 cat $*