]> git.ipfire.org Git - thirdparty/cups.git/blob - test/testfile.ps
Remove svn:keywords since they cause svn_load_dirs.pl to complain about every file.
[thirdparty/cups.git] / test / testfile.ps
1 %!PS-Adobe-3.0
2 %%BoundingBox: 0 0 612 792
3 %%Pages: 1
4 %%LanguageLevel: 1
5 %%DocumentData: Clean7Bit
6 %%DocumentSuppliedResources: procset testprint/1.0
7 %%DocumentNeededResources: font Helvetica Helvetica-Bold Times-Roman
8 %%Creator: Michael Sweet, Easy Software Products
9 %%CreationDate: May 11, 1999
10 %%Title: Test Page
11 %%EndComments
12 %%BeginProlog
13 %%BeginResource procset testprint 1.2 0
14 %
15 % PostScript test page for the Common UNIX Printing System ("CUPS").
16 %
17 % Copyright 1993-2005 Easy Software Products
18 %
19 % These coded instructions, statements, and computer programs are the
20 % property of Easy Software Products and are protected by Federal
21 % copyright law. Distribution and use rights are outlined in the file
22 % "LICENSE.txt" which should have been included with this file. If this
23 % file is missing or damaged please contact Easy Software Products
24 % at:
25 %
26 % Attn: CUPS Licensing Information
27 % Easy Software Products
28 % 44141 Airport View Drive, Suite 204
29 % Hollywood, Maryland 20636 USA
30 %
31 % Voice: (301) 373-9600
32 % EMail: cups-info@cups.org
33 % WWW: http://www.cups.org
34 %
35 /SEXTANT { % Draw a color wheel sextant...
36 % (name) white radius r g b SEXTANT -
37 % Loop through 100 shades...
38 0 0.010101 0.98 {
39 % Set the color...
40 dup 0.75 le { % Get "white" value
41 % Start from black
42 dup 0.75 div % val2 = val / 0.75
43
44 0 index 5 index mul % R = R * val2
45 1 index 5 index mul % G = G * val2
46 2 index 5 index mul % B = B * val2
47
48 4 -1 roll pop % Discard val2
49 } {
50 % Fade to white
51 dup neg 1 add 4 mul % val2 = (1 - val) * 4
52
53 0 index 5 index mul % R = R * val2
54 1 index neg 1 add add % + (1 - val2)
55 1 index 5 index mul % G = G * val2
56 2 index neg 1 add add % + (1 - val2)
57 2 index 5 index mul % B = B * val2
58 3 index neg 1 add add % + (1 - val2)
59
60 4 -1 roll pop % Discard val2
61 } ifelse
62 setrgbcolor % Set the color...
63
64 % Draw the polygon...
65 newpath % Start a new path...
66 dup 5 index mul % r1 = radius * val
67 0 0 3 -1 roll 0 60 arc % Draw the inner arc
68
69 dup 0.010101 add 5 index mul% r2 = (radius + 0.010101) * val
70 0 0 3 -1 roll 60 0 arcn % Draw the outer arc
71
72 closepath % Close the path
73 fill % Fill it...
74
75 pop % Pop value...
76 } for
77
78 % Draw a line around the polygons...
79 pop pop pop dup % Pop R, G, B, start
80 0 setgray % Black
81 newpath
82 0 0 moveto % Center
83 0 0 3 -1 roll 0 60 arc % Arc around octant
84 closepath % Back to center
85 stroke % Stroke it...
86
87 % Draw the label...
88 dup % Save radius
89 dup 30 cos mul % X = radius * cos(30)
90 exch 30 sin mul % Y = radius * sin(30)
91 moveto % Position label
92
93 gsave
94 30 rotate % Rotate label
95 dup 0.05 mul % Offset to the right
96 exch -0.05 mul % and down...
97 rmoveto % Offset label
98 show % Show label
99 grestore
100 } bind def
101 /CENTER { % Draw centered text
102 % (name) CENTER -
103 dup stringwidth pop % Get the width of the string
104 0.5 mul neg 0 rmoveto % Shift left 1/2 of the distance
105 show % Show the string
106 } bind def
107 /RIGHT { % Draw right-justified text
108 % (name) RIGHT -
109 dup stringwidth pop % Get the width of the string
110 neg 0 rmoveto % Shift left the entire distance
111 show % Show the string
112 } bind def
113 /NUMBER { % Draw a number
114 % power n NUMBER -
115 1 index 1 eq { % power == 1?
116 round cvi exch pop % Convert "n" to integer
117 } {
118 1 index mul round exch div % Truncate extra decimal places
119 } ifelse
120 100 string cvs show % Convert to a string and show it...
121 } bind def
122 /CUPSLOGO { % Draw the CUPS logo
123 % height CUPSLOGO
124 % Start with a big C...
125 /Helvetica findfont 1 index scalefont setfont
126 0 setgray
127 0 0 moveto
128 (C) show
129
130 % Then "UNIX Printing System" much smaller...
131 /Helvetica-Bold findfont 1 index 9 div scalefont setfont
132 0.25 mul
133 dup dup 2.0 mul moveto
134 (UNIX) show
135 dup dup 1.6 mul moveto
136 (Printing) show
137 dup 1.2 mul moveto
138 (System) show
139 } bind def
140 /ESPLOGO { % Draw the ESP logo
141 % height ESPLOGO
142 % Compute the size of the logo...
143 0 0
144 2 index 1.5 mul 3 index
145
146 % Do the "metallic" fill from 10% black to 40% black...
147 1 -0.001 0 {
148 dup % loopval
149 -0.15 mul % loopval * -0.15
150 0.9 add % 0.9 - loopval * 0.15
151 setgray % set gray shade
152
153 0 % x
154 1 index neg % loopval
155 1 add % 1 - loopval
156 3 index % height
157 mul % height * (1 - loopval)
158 moveto % starting point
159
160 dup % loopval
161 3 index % width
162 mul % loopval * width
163 2 index % height
164 lineto % Next point
165
166 0 % x
167 2 index % height
168 lineto % Next point
169
170 closepath
171 fill
172
173 dup % loopval
174 0.15 mul % loopval * 0.15
175 0.6 add % 0.6 + loopval * 0.15
176 setgray
177
178 dup % loopval
179 neg 1 add % 1 - loopval
180 3 index % width
181 mul % (1 - loopval) * width
182 0 % y
183 moveto % Starting point
184
185 2 index % width
186 exch % loopval
187 2 index % height
188 mul % loopval * height
189 lineto % Next point
190
191 1 index % width
192 0 % y
193 lineto % Next point
194
195 closepath
196 fill
197 } for
198
199 0 setgray rectstroke
200
201 /Helvetica-BoldOblique findfont 1 index 3 div scalefont setfont
202 dup 40 div
203
204 dup 4 mul 1 index 25 mul moveto (E) show
205 dup 10 mul 1 index 15 mul moveto (S) show
206 dup 16 mul 1 index 5 mul moveto (P) show
207
208 /Helvetica-BoldOblique findfont 2 index 5 div scalefont setfont
209 dup 14 mul 1 index 29 mul moveto (asy) show
210 dup 20 mul 1 index 19 mul moveto (oftware) show
211 dup 26 mul 1 index 9 mul moveto (roducts) show
212
213 pop
214 } bind def
215 %%EndResource
216 %%EndProlog
217 %%Page: 1 1
218 gsave
219
220 % Determine the imageable area and device resolution...
221 initclip newpath clippath pathbbox % Get bounding rectangle
222 72 div /pageTop exch def % Get top margin in inches
223 72 div /pageRight exch def % Get right margin in inches
224 72 div /pageBottom exch def % Get bottom margin in inches
225 72 div /pageLeft exch def % Get left margin in inches
226
227 4 setlinewidth % Draw wide lines
228 0 setgray closepath stroke % Draw a clipping rectangle
229 1 setlinewidth % Draw normal lines
230
231 /pageWidth pageRight pageLeft sub def % pageWidth = pageRight - pageLeft
232 /pageHeight pageTop pageBottom sub def% pageHeight = pageTop - pageBottom
233
234 72 72 dtransform % Get device resolution per inch
235 /yResolution exch abs def % yResolution = abs(yres)
236 /xResolution exch abs def % xResolution = abs(xres)
237
238 % Figure out the sizes of things...
239 /wheelSize % size of wheels
240 pageWidth pageHeight lt
241 { pageWidth 9 mul }
242 { pageHeight 7 mul }
243 ifelse def
244
245 % Create fonts...
246 /bigFont /Helvetica-Bold findfont % bigFont = Helvetica-Bold
247 pageHeight 3 mul scalefont def % size = pageHeight * 3 (nominally 33)
248
249 /mediumFont /Helvetica findfont % mediumFont = Helvetica
250 pageHeight 1.5 mul scalefont def % size = pageHeight * 1.5 (nominally 16.5)
251
252 /smallFont /Times-Roman findfont % smallFont = Times-Roman
253 pageHeight scalefont def % size = pageHeight (nominally 11)
254
255 % Offset page to account for lower-left margin...
256 pageLeft 72 mul
257 pageBottom 72 mul
258 translate
259
260 % Set text font and color...
261 mediumFont setfont % Font
262 0 setgray % Color
263
264 % Draw the color wheel...
265 gsave
266 % Position the wheel on the left side...
267 pageWidth 18 mul % x = pageWidth * 1/4 * 72
268 pageHeight 54 mul % y = pageHeight * 3/4 * 72
269 translate
270
271 % Size the wheel...
272 wheelSize
273
274 % Draw the colors...
275 dup (C) 3 -1 roll 0 1 1 SEXTANT 60 rotate
276 dup (M) 3 -1 roll 1 0 1 SEXTANT 60 rotate
277 dup (Y) 3 -1 roll 1 1 0 SEXTANT 60 rotate
278 dup (R) 3 -1 roll 1 0 0 SEXTANT 60 rotate
279 dup (G) 3 -1 roll 0 1 0 SEXTANT 60 rotate
280 dup (B) 3 -1 roll 0 0 1 SEXTANT 60 rotate
281
282 pop
283 grestore
284
285 % Label the color wheel...
286 pageWidth 18 mul % x = pageWidth * 1/4 * 72
287 pageHeight 44 mul % y = pageHeight * 19/32 * 72
288 moveto % Position the text
289 (Color Wheel) CENTER % Show the text centered
290
291 % Draw the gray ramp...
292 gsave
293 % Position the gray ramp in the center...
294 pageWidth 36 mul % x = pageWidth * 1/2 * 72
295 pageHeight 54 mul % y = pageHeight * 3/4 * 72
296 wheelSize sub % - wheelSize
297 translate
298
299 % Loop through 100 shades...
300 0 0.010101 0.98 {
301 % Set the color...
302 dup setgray % Set the grayscale...
303
304 % Draw the polygon...
305 newpath % Start a new path...
306
307 wheelSize -0.2 mul % X = -wheelSize / 5
308 1 index 2 mul wheelSize mul % Y = val * 2 * wheelSize
309 moveto % Move there...
310
311 wheelSize 0.4 mul 0 rlineto % Right side...
312
313 wheelSize 0.2 mul % X = wheelSize / 5
314 1 index 0.010101 add 2 mul wheelSize mul
315 % Y = (val + 0.010101) * 2 * wheelSize
316 lineto % Move there...
317
318 wheelSize -0.4 mul 0 rlineto % Left side...
319
320 closepath % Close the path
321 fill % Fill it...
322
323 pop % Pop value...
324 } for
325
326 0 setgray % Black
327
328 newpath % Start a new path
329 wheelSize -0.2 mul 0 moveto % Bottom left
330 wheelSize 0.4 mul 0 rlineto % Bottom right
331 0 wheelSize 2 mul rlineto % Upper right
332 wheelSize -0.4 mul 0 rlineto % Upper left
333 closepath % Close the path
334 stroke % Stroke it...
335
336 0 wheelSize -0.2 mul moveto % Center bottom for label
337 (K) CENTER % Center K at bottom
338
339 0 wheelSize 2.05 mul moveto % Center top for label
340 (W) CENTER % Center W at top
341 grestore
342
343 % Label the gray ramp...
344 pageWidth 36 mul % x = pageWidth * 1/2 * 72
345 pageHeight 44 mul % y = pageHeight * 19/32 * 72
346 moveto % Position the text
347 (Gray Ramp) CENTER % Show the text centered
348
349
350 % Draw radial lines...
351 gsave
352 0 setlinewidth % 1 pixel lines
353
354 % Position the lines on the left side...
355 pageWidth 54 mul % x = pageWidth * 3/4 * 72
356 pageHeight 54 mul % y = pageHeight * 3/4 * 72
357 translate
358
359 % Size the wheel...
360 wheelSize
361
362 % Loop at 1 degree increments
363 0 1 359 {
364 pop % Discard angle - not used
365 0 0 moveto % Start line at the center
366 dup 0 lineto % Draw to the radius
367 1 rotate % Rotate 1 degree
368 } for
369
370 pop % Discard radius - not needed anymore
371 stroke % Draw lines...
372
373 grestore
374
375 % Label the lines...
376 pageWidth 54 mul % x = pageWidth * 3/4 * 72
377 pageHeight 44 mul % y = pageHeight * 19/32 * 72
378 moveto % Position the text
379 (1 Degree Radial Lines) CENTER % Show the text centered
380
381 % Imageable area...
382 pageHeight 15 mul % Height of imageable area
383
384 pageWidth 4.5 mul % x = pageWidth * 1/16 * 72
385 pageHeight 35.5 mul % y = pageHeight * 1/2 * 72
386 2 index sub % y -= height
387 pageWidth 28 mul % width = pageWidth * 1/4 * 72
388 3 index % height
389 0.5 setgray rectfill % Draw a shadow
390
391 pageWidth 4 mul % x = pageWidth * 1/16 * 72
392 pageHeight 36 mul % y = pageHeight * 1/2 * 72
393 2 index sub % y -= height
394 pageWidth 28 mul % width = pageWidth * 3/8 * 72
395 3 index % height
396 4 copy 1 setgray rectfill % Clear the box to white
397 0 setgray rectstroke % Draw a black box around it...
398
399 pop % Discard height
400
401 % Label the imageable area...
402 pageWidth 4 mul % x = pageWidth * 1/16 * 72
403 pageHeight 37 mul % y = pageHeight * 1/2 * 72
404 moveto % Position the text
405 mediumFont setfont % Font
406 (Imageable Area) show % Show the text
407
408 smallFont setfont % Font
409 pageWidth 14 mul % x = pageWidth * 3/16 * 72
410 pageHeight 36 mul % y = pageWidth * 1/2 * 72
411 pageHeight -2 mul add % y -= 2 * smallFont height
412
413 % Page Size inches
414 2 copy moveto % Move to x & y
415 (Page Size: ) RIGHT % Label
416 100 pageWidth NUMBER % pageWidth
417 (x) show % "x"
418 100 pageHeight NUMBER % pageHeight
419 (in) show % "in"
420
421 % Page Size millimeters
422 pageHeight sub % Move down...
423
424 2 copy moveto % Move to x & y
425 10 pageWidth 25.4 mul NUMBER % pageWidth
426 (x) show % "x"
427 10 pageHeight 25.4 mul NUMBER % pageHeight
428 (mm) show % "mm"
429
430 % Lower-left inches
431 pageHeight 2 mul sub % Move down...
432
433 2 copy moveto % Move to x & y
434 (Lower-Left: ) RIGHT % Label
435 100 pageLeft NUMBER % pageLeft
436 (x) show % "x"
437 100 pageBottom NUMBER % pageBottom
438 (in) show % "in"
439
440 % Lower-left millimeters
441 pageHeight sub % Move down...
442
443 2 copy moveto % Move to x & y
444 10 pageLeft 25.4 mul NUMBER % pageLeft
445 (x) show % "x"
446 10 pageBottom 25.4 mul NUMBER % pageBottom
447 (mm) show % "mm"
448
449 % Upper-right inches
450 pageHeight 2 mul sub % Move down...
451
452 2 copy moveto % Move to x & y
453 (Upper-Right: ) RIGHT % Label
454 100 pageRight NUMBER % pageRight
455 (x) show % "x"
456 100 pageTop NUMBER % pageTop
457 (in) show % "in"
458
459 % Upper-right millimeters
460 pageHeight sub % Move down...
461
462 2 copy moveto % Move to x & y
463 10 pageRight 25.4 mul NUMBER % pageRight
464 (x) show % "x"
465 10 pageTop 25.4 mul NUMBER % pageTop
466 (mm) show % "mm"
467
468 % Resolution dots-per-inch
469 pageHeight 2 mul sub % Move down...
470
471 2 copy moveto % Move to x & y
472 (Resolution: ) RIGHT % Label
473 1 xResolution NUMBER % xResolution
474 (x) show % "x"
475 1 yResolution NUMBER % yResolution
476 (dpi) show % "dpi"
477
478 % Resolution dots-per-meter
479 pageHeight sub % Move down...
480
481 moveto % Move to x & y
482 1 xResolution 39.27 mul NUMBER % xResolution
483 (x) show % "x"
484 1 yResolution 39.27 mul NUMBER % yResolution
485 (dpm) show % "dpm"
486
487 % Interpreter Information...
488 pageHeight 15 mul % Height of interpreter information
489
490 pageWidth 40.5 mul % x = pageWidth * 9/16 * 72
491 pageHeight 35.5 mul % y = pageHeight * 1/2 * 72
492 2 index sub % y -= height
493 pageWidth 28 mul % width = pageWidth * 1/4 * 72
494 3 index % height
495 0.5 setgray rectfill % Draw a shadow
496
497 pageWidth 40 mul % x = pageWidth * 9/16 * 72
498 pageHeight 36 mul % y = pageHeight * 1/2 * 72
499 2 index sub % y -= height
500 pageWidth 28 mul % width = pageWidth * 3/8 * 72
501 3 index % height
502 4 copy 1 setgray rectfill % Clear the box to white
503 0 setgray rectstroke % Draw a black box around it...
504
505 pop % Discard height
506
507 % Label the interpreter info...
508 pageWidth 40 mul % x = pageWidth * 9/16 * 72
509 pageHeight 37 mul % y = pageHeight * 1/2 * 72
510 moveto % Position the text
511 mediumFont setfont % Font
512 (Interpreter Information) show % Show the text
513
514 smallFont setfont % Font
515 pageWidth 49 mul % x = pageWidth * 11/16 * 72
516 pageHeight 36 mul % y = pageWidth * 1/2 * 72
517 pageHeight 2 mul sub % y -= 2 * smallFont height
518
519 % Language level
520 2 copy moveto % Move to x & y
521 (PostScript: ) RIGHT % Label
522 (Level ) show % "Level "
523 1 languagelevel NUMBER % Language level
524
525 % Version
526 pageHeight 2 mul sub % Move down...
527 2 copy moveto % Move to x & y
528 (Version: ) RIGHT % Label
529 version show % Version
530 ( \() show % " ("
531 1 revision NUMBER % Revision
532 (\)) show % ")"
533
534 % Product
535 pageHeight 2 mul sub % Move down...
536 2 copy moveto % Move to x & y
537 (Product: ) RIGHT % Label
538 product show % Product name
539
540 % Serial Number
541 pageHeight 2 mul sub % Move down...
542 2 copy moveto % Move to x & y
543 (Serial #: ) RIGHT % Label
544 1 serialnumber NUMBER % S/N
545
546 % Draw the label at the top...
547 pageWidth 36 mul % Center of page
548 pageHeight 68 mul % Top of page (15/16ths)
549 2 copy moveto % Position text
550 bigFont setfont % Font
551 (Printer Test Page) CENTER % Show text centered
552
553 % Draw the copyright notice at the bottom...
554 pageWidth 36 mul % Center of page
555 pageHeight 10 mul % Bottom of page
556 2 copy moveto % Position text
557 (Printed Using CUPS v1.2.x) CENTER % Show text centered
558
559 pageHeight 2 mul sub % Move down...
560 2 copy moveto % Position text
561 smallFont setfont % Font
562 (Copyright 1993-2005 Easy Software Products, All Rights Reserved.) CENTER
563 pageHeight sub % Move down...
564 2 copy moveto % Position text
565 (CUPS, and the CUPS logo are the trademark property of) CENTER
566 pageHeight sub % Move down...
567 2 copy moveto % Position text
568 (Easy Software Products, 44141 Airport View Drive, Suite 204,) CENTER
569 pageHeight sub % Move down...
570 2 copy moveto % Position text
571 (Hollywood, Maryland, 20636, USA.) CENTER
572
573 % Then the CUPS logo....
574 gsave
575 pageWidth 4 mul
576 pageHeight 4 mul
577 translate
578 pageWidth 9 mul CUPSLOGO
579 grestore
580
581 % And the ESP logo....
582 gsave
583 pageWidth 59 mul
584 pageHeight 4 mul
585 translate
586 pageWidth 6 mul ESPLOGO
587 grestore
588 % Show the page...
589 grestore
590 showpage
591 %
592 % End of "$Id: testfile.ps 179 2006-06-21 18:38:41Z jlovell $".
593 %
594 %%EOF