Imported Upstream version 2.4.4p3
[debian/amanda] / example / 8.5x11.ps
1 %!
2 %%BoundingBox: 25 25 290 900
3 %%Title: AMANDA Full Page Label
4 %%Creator: Amanda reporter
5 %%Pages: 1
6 %%EndComments
7
8 %%%%
9 %%%% This is a template file used by AMANDA to create 8.5 x 11 inch
10 %%%% PostScript dump logs for each dump.
11 %%%%
12
13 %
14 % The label is made up of 6 parts:  statistics, tape name, date,
15 % header, filesystem list, and the logo.  Geometrically, the label 
16 % looks like this:
17 %
18 %   +----+-------------------+
19 %   |        TAPE_NAME       |   <- section 'A'
20 %   | version  Location date |   <- section 'B'
21 %   +------------------------+
22 %   |statistics  |  message  |   <- section 'C' | 'F'
23 %   +----+--+--------+-------+
24 %   | f# hst fs lvl O-KB C-KB|   <- section 'D'
25 %   +-------+--------+-------+
26 %   |       |        |       |   <- section 'E'
27 %   |       |        |       |
28 %   v       v        v       v
29 %
30
31 % section 'A' font and position (text centered around this point)
32 %
33 /TitleFont              { /Helvetica-Bold findfont 24 scalefont setfont } def
34 /TitlePos               { 321 728 } def
35
36 % section 'B' font, position of the date (left justified) and the version
37 %
38 /DateFont               { /Palatino-Bold findfont 11 scalefont setfont } def
39 /DatePos                { 580 715 } def
40 /VersFont               { /Palatino-Bold findfont 11 scalefont setfont } def
41 /VersPos                { 43 715 } def
42 /LocFont                { /Helvetica-Bold findfont 12 scalefont setfont } def
43 /LocPos                 { 321 715 } def
44
45 % section 'C' font, start position, and line separation
46 %
47 /StatFont               { /Courier findfont 9 scalefont setfont } def
48 /StatPos                { 43 695 } def
49 /StatSep                { 9 } def
50
51 % section 'D' font, and field positions (x coord is relative to each column)
52 %
53
54 /HeadingFont            { /Palatino-Bold findfont 9 scalefont setfont } def
55 /HeadingFilePos         { 43 644 } def
56 /HeadingHostPos         { 73 644 } def
57 /HeadingFsPos           { 198 644 } def
58 /HeadingLvlPos          { 333 644 } def
59 /HeadingOSizePos1       { 403 652 } def
60 /HeadingOSizePos        { 403 644 } def
61 /HeadingCSizePos1       { 483 652 } def
62 /HeadingCSizePos        { 483 644 } def
63
64
65 % section 'E' font, and line separation
66 %
67 /HostFont               { /Courier findfont 9 scalefont setfont } def
68 /HostSep                { 10 } def
69 /HostBasePos            { 38 630 } def
70
71 % section 'F' font, and line separation
72 %
73 /MessFont               { /Courier findfont 9 scalefont setfont } def
74 /MessPos                { 215 702 } def
75 /MessSep                { 9 } def
76
77
78 % the following rectangles separate the regions
79 %
80 /TitleBox               { 590 750 38 710 } def
81 /StatBox                { 590 710 38 660 } def
82 /HeadingBox             { 590 660 38 640 } def
83 /HostBox                { 590 640 38 0 } def
84 /CFline                 { 208 710 208 660 } def
85
86
87
88
89 %%%%
90 %%%% END OF USER-CONFIGURABLE OPTIONS
91 %%%%
92 %%%% the rest of this file contains the internal functions that are used
93 %%%% by genlabel to draw the label
94 %%%%
95
96
97 %
98 % Initial Setup... draws everything that is the same for all labels
99 %
100
101 % function to draw a box
102 %
103 /box {
104         /ury exch def
105         /urx exch def
106         /lly exch def
107         /llx exch def
108
109         llx lly moveto
110         llx ury lineto
111         urx ury lineto
112         urx lly lineto
113         closepath
114 } def
115
116
117 % move the origin up a bit
118 %
119 0 20 translate
120
121 % draw all of the boxes
122 %
123 0 setgray 
124 2 setlinewidth                                  % thick lines
125 StatBox box stroke
126 TitleBox box stroke
127 HeadingBox box stroke
128 HostBox box stroke
129 CFline moveto lineto stroke
130
131
132 HeadingFont
133 HeadingFilePos  moveto
134   (File #) show
135 HeadingHostPos moveto
136   (Host) show
137 HeadingFsPos moveto
138   (File System) show
139 HeadingLvlPos moveto
140   (Level) stringwidth pop 2 div neg 0 rmoveto (Level) show
141 HeadingOSizePos1 moveto
142   (Original) stringwidth pop 2 div neg 0 rmoveto (Original) show
143 HeadingOSizePos moveto
144   (File Size (KB)) stringwidth pop 2 div neg 0 rmoveto (File Size (KB)) show
145 HeadingCSizePos1 moveto
146   (Compressed) stringwidth pop 2 div neg 0 rmoveto (Compressed) show
147 HeadingCSizePos moveto
148   (File Size (KB)) stringwidth pop 2 div neg 0 rmoveto (File Size (KB)) show
149
150
151 %
152 % the following functions draw strings for each kind of information
153 %
154
155 /CurrStatY StatPos exch pop def
156 /CurrMessY MessPos exch pop def
157 HostBasePos /CurrColumnY exch def
158 /CurrColumnX exch def
159
160
161 % DrawStat draws the string on the top of the stack in the next position
162 % in section 'A'
163 %
164 /DrawStat {
165         StatFont
166         StatPos pop CurrStatY moveto
167         show
168         /CurrStatY CurrStatY StatSep sub def
169 } def
170
171
172 % DrawTitle draws the string on the top of the stack in section 'B'
173 %
174 /DrawTitle {
175         TitleFont
176         TitlePos moveto
177         dup stringwidth pop 2 div neg 0 rmoveto
178         show
179 } def
180
181
182 % DrawDate draws the string on the top of the stack in section 'C'
183 %
184 /DrawDate {
185         DateFont
186         DatePos moveto
187         dup stringwidth pop neg 0 rmoveto
188         show
189 } def
190
191 % DrawLoc draws the string on the top of the stack in section 'C'
192 %
193 /DrawLoc {
194         LocFont
195         LocPos moveto
196         dup stringwidth pop 2 div neg 0 rmoveto
197         show
198 } def
199
200 % DrawVers draws the string on the top of the stack in section 'C'
201 %
202 /DrawVers {
203         VersFont
204         VersPos moveto
205         show
206 } def
207
208 % DrawMess draws the string on the top of the stack in section 'F'
209 %
210 /DrawMess {
211         MessFont
212         MessPos pop CurrMessY moveto
213         show
214         /CurrMessY CurrMessY MessSep sub def
215 } def
216
217 % Fill in Location name and message
218 %
219 (Magic Software Development, Inc.) DrawLoc
220
221 (To restore:) DrawMess
222 (    position tape at the start of the file and run:) DrawMess
223 (        dd if=/dev/nrst0 bs=32k skip=1 | zcat | restore -if -) DrawMess
224 (    or run:) DrawMess
225 (        amrestore -p /dev/nrst0 <host> <filesystem> | restore -if -) DrawMess
226
227
228 % DrawHost expects six strings to be on the stack.  The strings are 
229 % Host Name, Partition Name, Dump Level, Tape File Number, and Output Size.
230 %
231 /DrawHost {
232         HostFont
233         .25 setlinewidth                        % thin lines
234         HeadingCSizePos pop CurrColumnY moveto
235         -22 0 rmoveto show
236         HeadingOSizePos pop CurrColumnY moveto
237         -22 0 rmoveto show
238         HeadingFilePos pop CurrColumnY moveto
239         show
240         HeadingLvlPos pop CurrColumnY moveto
241         show
242         HeadingFsPos pop CurrColumnY moveto
243         show
244         HeadingHostPos pop CurrColumnY moveto
245         show
246         38 CurrColumnY 2.5 sub moveto 590 CurrColumnY 2.5 sub lineto stroke
247         /CurrColumnY CurrColumnY HostSep sub def
248 } def
249
250
251 %%%%
252 %%%% END OF TEMPLATE FILE
253 %%%%