2 %%BoundingBox: 0 0 612 792
5 %%DocumentData: Clean7Bit
6 %%DocumentSuppliedResources: procset testprint/1.2
7 %%DocumentNeededResources: font Helvetica Helvetica-Bold Times-Roman
8 %%Creator: Michael Sweet, Easy Software Products
9 %%CreationDate: D:20051002193000+0500
13 %%BeginResource procset testprint 1.2 0
15 % PostScript test page for the Common UNIX Printing System ("CUPS").
17 % Copyright 1993-2005 Easy Software Products
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
26 % Attn: CUPS Licensing Information
27 % Easy Software Products
28 % 44141 Airport View Drive, Suite 204
29 % Hollywood, Maryland 20636 USA
31 % Voice: (301) 373-9600
32 % EMail: cups-info@cups.org
33 % WWW: http://www.cups.org
35 /SEXTANT { % Draw a color wheel sextant...
36 % (name) white radius r g b SEXTANT -
37 % Loop through 100 shades...
40 dup 0.75 le { % Get "white" value
42 dup 0.75 div % val2 = val / 0.75
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
48 4 -1 roll pop % Discard val2
51 dup neg 1 add 4 mul % val2 = (1 - val) * 4
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)
60 4 -1 roll pop % Discard val2
62 setrgbcolor % Set the color...
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
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
72 closepath % Close the path
78 % Draw a line around the polygons...
79 pop pop pop dup % Pop R, G, B, start
83 0 0 3 -1 roll 0 60 arc % Arc around octant
84 closepath % Back to center
89 dup 30 cos mul % X = radius * cos(30)
90 exch 30 sin mul % Y = radius * sin(30)
91 moveto % Position label
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
101 /CENTER { % Draw centered text
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
107 /RIGHT { % Draw right-justified text
109 dup stringwidth pop % Get the width of the string
110 neg 0 rmoveto % Shift left the entire distance
111 show % Show the string
113 /NUMBER { % Draw a number
115 1 index 1 eq { % power == 1?
116 round cvi exch pop % Convert "n" to integer
118 1 index mul round exch div % Truncate extra decimal places
120 100 string cvs show % Convert to a string and show it...
122 /CUPSLOGO { % Draw the CUPS logo
124 % Start with a big C...
125 /Helvetica findfont 1 index scalefont setfont
130 % Then "UNIX Printing System" much smaller...
131 /Helvetica-Bold findfont 1 index 9 div scalefont setfont
133 dup dup 2.0 mul moveto
135 dup dup 1.6 mul moveto
140 /ESPLOGO { % Draw the ESP logo
145 /Helvetica-Bold findfont 38.2 scalefont setfont
147 -3 19.5 moveto (ESP) show
149 /Helvetica-Narrow-Oblique findfont 8.2 scalefont setfont
150 0 2 moveto (Easy Software Products) show
152 1 -0.01 0 { dup neg 1.0 add setgray 0 11 3 -1 roll 68 mul 4.5 rectfill } for
155 67.5 11 4.5 4.5 rectfill
163 % Determine the imageable area and device resolution...
164 initclip newpath clippath pathbbox % Get bounding rectangle
165 72 div /pageTop exch def % Get top margin in inches
166 72 div /pageRight exch def % Get right margin in inches
167 72 div /pageBottom exch def % Get bottom margin in inches
168 72 div /pageLeft exch def % Get left margin in inches
170 4 setlinewidth % Draw wide lines
171 0 setgray closepath stroke % Draw a clipping rectangle
173 /pageWidth pageRight pageLeft sub def % pageWidth = pageRight - pageLeft
174 /pageHeight pageTop pageBottom sub def% pageHeight = pageTop - pageBottom
176 72 72 dtransform % Get device resolution per inch
177 /yResolution exch abs def % yResolution = abs(yres)
178 /xResolution exch abs def % xResolution = abs(xres)
180 % Figure out the sizes of things...
181 /wheelSize % size of wheels
182 pageWidth pageHeight lt
188 /bigFont /Helvetica-Bold findfont % bigFont = Helvetica-Bold
189 pageHeight 3 mul scalefont def % size = pageHeight * 3 (nominally 33)
191 /mediumFont /Helvetica findfont % mediumFont = Helvetica
192 pageHeight 1.5 mul scalefont def % size = pageHeight * 1.5 (nominally 16.5)
194 /smallFont /Times-Roman findfont % smallFont = Times-Roman
195 pageHeight scalefont def % size = pageHeight (nominally 11)
197 % Draw rulers along the edges...
198 /CENTIMETER 72 2.54 div def
199 /MILLIMETER 72 25.4 div def
201 smallFont setfont % Font
203 gsave % Left side inches
204 pageLeft 72 mul 0 translate % Offset left edge
206 1 setlinewidth % Draw normal lines
207 72 72 pageTop 72 mul { % Height inches
209 0 exch moveto 24 0 rlineto stroke % Draw tic mark
210 24 exch pageHeight sub moveto % Draw number
211 72 div cvi 10 string cvs RIGHT
214 0.5 setlinewidth % Draw thin lines
215 18 18 pageTop 72 mul { % 1/4 inches
216 0 exch moveto 15 0 rlineto stroke % Draw tic mark
219 9 9 pageTop 72 mul { % 1/8 inches
220 0 exch moveto 6 0 rlineto stroke % Draw tic mark
224 gsave % Bottom inches
225 0 pageBottom 72 mul translate % Offset bottom edge
227 1 setlinewidth % Draw normal lines
228 72 72 pageRight 72 mul { % Width inches
230 0 moveto 0 24 rlineto stroke % Draw tic mark
231 3 add 27 pageHeight sub moveto % Draw number
232 72 div cvi 10 string cvs show
235 0.5 setlinewidth % Draw thin lines
236 18 18 pageRight 72 mul { % 1/4 inches
237 0 moveto 0 15 rlineto stroke % Draw tic mark
240 9 9 pageRight 72 mul { % 1/8 inches
241 0 moveto 0 6 rlineto stroke % Draw tic mark
245 gsave % Right side centimeters
246 pageRight 72 mul 0 translate % Offset right edge
248 1 setlinewidth % Draw normal lines
249 CENTIMETER CENTIMETER
250 pageTop 72 mul { % Height centimeters
251 0 exch moveto -24 0 rlineto stroke% Draw tic mark
253 1 1 pageTop 2.54 mul { % Height labels
255 -24 exch CENTIMETER mul
256 pageHeight sub moveto % Draw number
257 cvi 10 string cvs show
260 0.5 setlinewidth % Draw thin lines
262 pageTop 72 mul { % 1/2 centimeters
263 0 exch moveto -15 0 rlineto stroke% Draw tic mark
265 0 MILLIMETER pageTop 72 mul { % Millimeters
266 0 exch moveto -6 0 rlineto stroke % Draw tic mark
270 gsave % Top centimeters
271 0 pageTop 72 mul translate % Offset top edge
273 1 setlinewidth % Draw normal lines
274 CENTIMETER CENTIMETER
275 pageRight 72 mul { % Width centimeters
276 0 moveto 0 -24 rlineto stroke % Draw tic mark
278 1 1 pageRight 2.54 mul { % Width labels
280 CENTIMETER mul 3 add -24 moveto % Draw number
281 cvi 10 string cvs show
284 0.5 setlinewidth % Draw thin lines
286 pageRight 72 mul { % 1/2 centimeters
287 0 moveto 0 -15 rlineto stroke % Draw tic mark
289 0 MILLIMETER pageRight 72 mul { % Millimeters
290 0 moveto 0 -6 rlineto stroke % Draw tic mark
294 % Offset page to account for lower-left margin...
299 % Set text font and color...
300 mediumFont setfont % Font
302 1 setlinewidth % Draw normal lines
304 % Draw the color wheel...
306 % Position the wheel on the left side...
307 pageWidth 18 mul % x = pageWidth * 1/4 * 72
308 pageHeight 54 mul % y = pageHeight * 3/4 * 72
315 dup (C) 3 -1 roll 0 1 1 SEXTANT 60 rotate
316 dup (M) 3 -1 roll 1 0 1 SEXTANT 60 rotate
317 dup (Y) 3 -1 roll 1 1 0 SEXTANT 60 rotate
318 dup (R) 3 -1 roll 1 0 0 SEXTANT 60 rotate
319 dup (G) 3 -1 roll 0 1 0 SEXTANT 60 rotate
320 dup (B) 3 -1 roll 0 0 1 SEXTANT 60 rotate
325 % Label the color wheel...
326 pageWidth 18 mul % x = pageWidth * 1/4 * 72
327 pageHeight 43 mul % y = pageHeight * 19/32 * 72
328 moveto % Position the text
329 (Color Wheel) CENTER % Show the text centered
331 % Draw the gray ramp...
333 % Position the gray ramp in the center...
334 pageWidth 36 mul % x = pageWidth * 1/2 * 72
335 pageHeight 54 mul % y = pageHeight * 3/4 * 72
336 wheelSize sub % - wheelSize
339 % Loop through 100 shades...
342 dup setgray % Set the grayscale...
344 % Draw the polygon...
345 newpath % Start a new path...
347 wheelSize -0.2 mul % X = -wheelSize / 5
348 1 index 2 mul wheelSize mul % Y = val * 2 * wheelSize
349 moveto % Move there...
351 wheelSize 0.4 mul 0 rlineto % Right side...
353 wheelSize 0.2 mul % X = wheelSize / 5
354 1 index 0.010101 add 2 mul wheelSize mul
355 % Y = (val + 0.010101) * 2 * wheelSize
356 lineto % Move there...
358 wheelSize -0.4 mul 0 rlineto % Left side...
360 closepath % Close the path
368 newpath % Start a new path
369 wheelSize -0.2 mul 0 moveto % Bottom left
370 wheelSize 0.4 mul 0 rlineto % Bottom right
371 0 wheelSize 2 mul rlineto % Upper right
372 wheelSize -0.4 mul 0 rlineto % Upper left
373 closepath % Close the path
374 stroke % Stroke it...
376 0 wheelSize -0.2 mul moveto % Center bottom for label
377 (K) CENTER % Center K at bottom
379 0 wheelSize 2.05 mul moveto % Center top for label
380 (W) CENTER % Center W at top
383 % Label the gray ramp...
384 pageWidth 36 mul % x = pageWidth * 1/2 * 72
385 pageHeight 43 mul % y = pageHeight * 19/32 * 72
386 moveto % Position the text
387 (Gray Ramp) CENTER % Show the text centered
390 % Draw radial lines...
392 0 setlinewidth % 1 pixel lines
394 % Position the lines on the left side...
395 pageWidth 54 mul % x = pageWidth * 3/4 * 72
396 pageHeight 54 mul % y = pageHeight * 3/4 * 72
402 % Loop at 1 degree increments
404 pop % Discard angle - not used
405 0 0 moveto % Start line at the center
406 dup 0 lineto % Draw to the radius
407 1 rotate % Rotate 1 degree
410 pop % Discard radius - not needed anymore
411 stroke % Draw lines...
416 pageWidth 54 mul % x = pageWidth * 3/4 * 72
417 pageHeight 43 mul % y = pageHeight * 19/32 * 72
418 moveto % Position the text
419 (1 Degree Radial Lines) CENTER % Show the text centered
422 pageHeight 15 mul % Height of imageable area
424 pageWidth 4.5 mul % x = pageWidth * 1/16 * 72
425 pageHeight 35.5 mul % y = pageHeight * 1/2 * 72
426 2 index sub % y -= height
427 pageWidth 28 mul % width = pageWidth * 1/4 * 72
429 0.5 setgray rectfill % Draw a shadow
431 pageWidth 4 mul % x = pageWidth * 1/16 * 72
432 pageHeight 36 mul % y = pageHeight * 1/2 * 72
433 2 index sub % y -= height
434 pageWidth 28 mul % width = pageWidth * 3/8 * 72
436 4 copy 1 setgray rectfill % Clear the box to white
437 0 setgray rectstroke % Draw a black box around it...
441 % Label the imageable area...
442 pageWidth 4 mul % x = pageWidth * 1/16 * 72
443 pageHeight 37 mul % y = pageHeight * 1/2 * 72
444 moveto % Position the text
445 mediumFont setfont % Font
446 (Imageable Area) show % Show the text
448 smallFont setfont % Font
449 pageWidth 14 mul % x = pageWidth * 3/16 * 72
450 pageHeight 36 mul % y = pageWidth * 1/2 * 72
451 pageHeight -2 mul add % y -= 2 * smallFont height
454 2 copy moveto % Move to x & y
455 (Page Size: ) RIGHT % Label
456 100 pageWidth NUMBER % pageWidth
458 100 pageHeight NUMBER % pageHeight
461 % Page Size millimeters
462 pageHeight sub % Move down...
464 2 copy moveto % Move to x & y
465 10 pageWidth 25.4 mul NUMBER % pageWidth
467 10 pageHeight 25.4 mul NUMBER % pageHeight
471 pageHeight 2 mul sub % Move down...
473 2 copy moveto % Move to x & y
474 (Lower-Left: ) RIGHT % Label
475 100 pageLeft NUMBER % pageLeft
477 100 pageBottom NUMBER % pageBottom
480 % Lower-left millimeters
481 pageHeight sub % Move down...
483 2 copy moveto % Move to x & y
484 10 pageLeft 25.4 mul NUMBER % pageLeft
486 10 pageBottom 25.4 mul NUMBER % pageBottom
490 pageHeight 2 mul sub % Move down...
492 2 copy moveto % Move to x & y
493 (Upper-Right: ) RIGHT % Label
494 100 pageRight NUMBER % pageRight
496 100 pageTop NUMBER % pageTop
499 % Upper-right millimeters
500 pageHeight sub % Move down...
502 2 copy moveto % Move to x & y
503 10 pageRight 25.4 mul NUMBER % pageRight
505 10 pageTop 25.4 mul NUMBER % pageTop
508 % Resolution dots-per-inch
509 pageHeight 2 mul sub % Move down...
511 2 copy moveto % Move to x & y
512 (Resolution: ) RIGHT % Label
513 1 xResolution NUMBER % xResolution
515 1 yResolution NUMBER % yResolution
518 % Resolution dots-per-meter
519 pageHeight sub % Move down...
521 moveto % Move to x & y
522 1 xResolution 39.27 mul NUMBER % xResolution
524 1 yResolution 39.27 mul NUMBER % yResolution
527 % Interpreter Information...
528 pageHeight 15 mul % Height of interpreter information
530 pageWidth 40.5 mul % x = pageWidth * 9/16 * 72
531 pageHeight 35.5 mul % y = pageHeight * 1/2 * 72
532 2 index sub % y -= height
533 pageWidth 28 mul % width = pageWidth * 1/4 * 72
535 0.5 setgray rectfill % Draw a shadow
537 pageWidth 40 mul % x = pageWidth * 9/16 * 72
538 pageHeight 36 mul % y = pageHeight * 1/2 * 72
539 2 index sub % y -= height
540 pageWidth 28 mul % width = pageWidth * 3/8 * 72
542 4 copy 1 setgray rectfill % Clear the box to white
543 0 setgray rectstroke % Draw a black box around it...
547 % Label the interpreter info...
548 pageWidth 40 mul % x = pageWidth * 9/16 * 72
549 pageHeight 37 mul % y = pageHeight * 1/2 * 72
550 moveto % Position the text
551 mediumFont setfont % Font
552 (Interpreter Information) show % Show the text
554 smallFont setfont % Font
555 pageWidth 49 mul % x = pageWidth * 11/16 * 72
556 pageHeight 36 mul % y = pageWidth * 1/2 * 72
557 pageHeight 2 mul sub % y -= 2 * smallFont height
560 2 copy moveto % Move to x & y
561 (PostScript: ) RIGHT % Label
562 (Level ) show % "Level "
563 1 languagelevel NUMBER % Language level
566 pageHeight 2 mul sub % Move down...
567 2 copy moveto % Move to x & y
568 (Version: ) RIGHT % Label
569 version show % Version
571 1 revision NUMBER % Revision
575 pageHeight 2 mul sub % Move down...
576 2 copy moveto % Move to x & y
577 (Product: ) RIGHT % Label
578 product show % Product name
581 pageHeight 2 mul sub % Move down...
582 moveto % Move to x & y
583 (Serial #: ) RIGHT % Label
584 1 serialnumber NUMBER % S/N
586 % Draw the label at the top...
587 pageWidth 36 mul % Center of page
588 pageHeight 66 mul % Top of page (11/12ths)
589 moveto % Position text
590 bigFont setfont % Font
591 (Printer Test Page) CENTER % Show text centered
593 % Draw the copyright notice at the bottom...
594 pageWidth 36 mul % Center of page
595 pageHeight 12 mul % Bottom of page
596 moveto % Position text
597 (Printed Using CUPS v1.2.x) CENTER % Show text centered
599 pageWidth 34 mul % Left-center of page
600 pageHeight 8 mul % Move down...
601 2 copy moveto % Position text
602 smallFont setfont % Font
603 (Copyright 1993-2005 Easy Software Products, All Rights Reserved.) CENTER
604 pageHeight sub % Move down...
605 2 copy moveto % Position text
606 (CUPS, and the CUPS logo are the trademark property of Easy Software Products,) CENTER
607 pageHeight sub % Move down...
608 2 copy moveto % Position text
609 (44141 Airport View Drive, Suite 204, Hollywood, Maryland, 20636, USA.) CENTER
610 pageHeight sub % Move down...
611 pageHeight sub % Move down...
612 moveto % Position text
613 (Need help? Contact your operating system vendor or visit "http://www.cups.org/".) CENTER
615 % Then the CUPS logo....
620 pageWidth 9 mul CUPSLOGO
623 % And the ESP logo....
628 pageWidth 6 mul ESPLOGO
634 % End of "$Id: testprint.ps 4743 2005-10-02 23:29:44Z mike $".