git ssb

0+

cel / ssb-invitation-cards



Tree: 04bc1183cb84befc323d264801480627dd239ead

Files: 04bc1183cb84befc323d264801480627dd239ead / cards.ps

1959 bytesRaw
1%!PS-Adobe-3.0
2%%Title: SSB Invitation Cards
3%%LanguageLevel: 2
4%%EndComments
5%%BeginProlog
6
7/MarginLeft {.75 inch} def
8/MarginBottom {.5 inch} def
9/NumRows 5 def
10/NumCols 2 def
11/GuideSize {.4 inch} def
12
13/line {
14 newpath
15 moveto
16 lineto
17 stroke
18} def
19
20/urlsfile (%stdin) (r) file def
21/urlstr 180 string def
22
23/DrawGuides {
24 gsave
25 .125 setlinewidth
26
27 % draw horizontal lines from the sides of the page
28 0 MarginBottom translate
29 NumRows 1 add {
30 0 0 GuideSize 0 line
31 PageWidth 0 PageWidth GuideSize sub 0 line
32 0 CardHeight translate
33 } repeat
34 0 CardHeight NumRows 1 add mul neg translate
35
36 % draw vertical lines from the top and bottom of the page
37 MarginLeft MarginBottom neg translate
38 NumCols 1 add {
39 0 0 0 GuideSize line
40 0 PageHeight 0 PageHeight GuideSize sub line
41 CardWidth 0 translate
42 } repeat
43
44 grestore
45} def
46
47/DrawBorder {
48 gsave
49 .25 setlinewidth
50
51 MarginLeft MarginBottom translate
52
53 % draw horizontal line
54 NumRows 1 add {
55 0 0 CardWidth NumCols mul 0 line
56 0 CardHeight translate
57 } repeat
58 0 CardHeight NumRows 1 add mul neg translate
59
60 % draw vertical lines
61 NumCols 1 add {
62 0 0 0 CardHeight NumRows mul line
63 CardWidth 0 translate
64 } repeat
65
66 grestore
67} def
68
69/DrawCardFrontWrap {
70 gsave
71 urlsfile urlstr readline {
72 /url exch def
73 DrawCardFront
74 /drewsome true def
75 } if
76 grestore
77} def
78
79/DrawCardBackWrap {
80 gsave
81 DrawCardBack
82 grestore
83} def
84
85currentpagedevice /PageSize get dup
860 get /PageWidth exch def
871 get /PageHeight exch def
88
89/DrawPage {
90 DrawGuides
91 %DrawBorder
92
93 MarginLeft MarginBottom CardHeight NumRows 1 sub mul add translate
94
95 % Draw cards
96 NumRows {
97 %NumCols {
98 % DrawCard
99 % CardWidth 0 translate
100 %} repeat
101 DrawCardFrontWrap
102 CardWidth 0 translate
103 DrawCardBackWrap
104 CardWidth 0 translate
105 NumCols CardWidth mul neg CardHeight neg translate
106 } repeat
107 0 NumRows CardHeight mul neg translate
108
109} def
110
111{
112 /drewsome false def
113 DrawPage
114 drewsome {
115 showpage
116 } {
117 exit
118 } ifelse
119} loop
120
121%%EOF
122

Built with git-ssb-web