%!PS
%David Mathog, mathog@caltech.edu
%04-NOV-2004
%Postscript page to test printer CMYK print alignment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/Times-Roman findfont 10 scalefont setfont
0 setlinewidth %thinnest possible lines
/inch {72 mul} def
/cyan { 1.0 0.0 0.0 0.0 setcmykcolor } def
/magenta { 0.0 1.0 0.0 0.0 setcmykcolor } def
/yellow { 0.0 0.0 1.0 0.0 setcmykcolor } def
/black { 0.0 0.0 0.0 1.0 setcmykcolor } def
black
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%centerstring
%from the web somewhere, centers a string
/centerstring {
dup stringwidth pop 2 div
currentpoint
3 -2 roll
exch sub exch
moveto
} def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% draws a line from x0,y0 to x1,y1
% usage: x0 y0 x1 y1 drawline
/drawline_inches {
newpath
inch 4 1 roll
inch 4 1 roll
inch 4 1 roll
inch 4 1 roll
moveto lineto
stroke
} def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% draws a vertical line from x,y0 to x,y1
% usage: y0 y1 x drawV3line
/drawV3line_inches {
newpath
0 index inch 3 index inch moveto %x,y0
0 index inch 2 index inch lineto %x,y1
stroke
pop
} def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% draws an horizontal line from x0,y to x1,y
% usage: x0 x1 y drawV3line
/drawH3line_inches {
newpath
2 index inch 1 index inch moveto %x0,y
1 index inch 1 index inch lineto %x1,y
stroke
pop
} def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% draws a box with corners at x0,y0 and x1,y1
%
/drawbox_inches {
newpath
3 index inch 3 index inch moveto %x0,y0
1 index inch 3 index inch lineto %x1,y0
1 index inch 1 index inch lineto %x1,y1
3 index inch 1 index inch lineto %x0,y1
closepath
stroke
} def
newpath
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% draw_vertical_line_cluster_inches
% usage:
% y0 y1 x0 xLast xinc
% draws N vertical lines with the first x0,y0 ->x0,y1
% and the last xLast,y0 -> xLast,y1.
%
%
/draw_vertical_line_cluster_inches {
{ drawV3line_inches } for
} def
% draw_horizontal_line_cluster_inches
% usage:
% x0 x1 y0 yLast yinc
% draws N horizontal lines with the first x0,y0 ->x1,y0
% and the last x1,yLast -> x1,yLast.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% draw_horizontal_line_cluster_inches
% usage:
% x0 x1 y0 yLast yinc
% draws N horizontal lines with the first x0,y0 ->x1,y0
% and the last x1,yLast -> x1,yLast.
%
%
/draw_horizontal_line_cluster_inches {
{ drawH3line_inches } for
} def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Note the 3.01 which is to handle rounding problems such
% that the final line is drawn. There are 41 lines in the
% black grid (40 intervals) and 40 lines in the colored
% grids (39 intervals). The line offset for each step is
% step - normal = 0.00128205128 inches
%
/normal 0.05 def
/step 0.05128205128 def
black
1 4.5 1 normal 3.01 draw_vertical_line_cluster_inches
magenta
1.5 2 1 step 3.01 draw_vertical_line_cluster_inches
cyan
2.5 3 1 step 3.01 draw_vertical_line_cluster_inches
yellow
3.5 4 1 step 3.01 draw_vertical_line_cluster_inches
black
4 7.5 1 normal 3.01 draw_horizontal_line_cluster_inches
magenta
4.5 5.0 1 step 3.01 draw_horizontal_line_cluster_inches
cyan
5.5 6.0 1 step 3.01 draw_horizontal_line_cluster_inches
yellow
6.5 7.0 1 step 3.01 draw_horizontal_line_cluster_inches
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Draw margin box and caption for same
%
%
1 setlinewidth %1 point lines
black
0.5 0.5 8.0 10.5 drawbox_inches
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Draw the page title
/Times-Roman findfont 20 scalefont setfont
4.25 inch 10.0 inch moveto
(Print and Color alignment test) centerstring show
/Times-Roman findfont 10 scalefont setfont
4.25 inch 9.0 inch moveto
(Adjust the printer so that colored bars) centerstring show
4.25 inch 8.8 inch moveto
(exactly overlap the end black bars.) centerstring show
4.25 inch 8.4 inch moveto
(The outer black rectangle should be 0.5 inches from all edges) centerstring show
showpage