#!/usr/bin/perl
# test page printing for up.  print arg pages, each with a box around
# the edges (.25 inches in), and the page number in large type.
#  This is useful for debugging page layouts, as well as just wasting
# paper.
#
# usage: makeup count
#
# jgreely@cis.ohio-state.edu, 89/10/23
#
$count = $ARGV[0];
die "usage: makeup count\n" unless $count > 0;

$date = `date`;
chop($date);

print <<EOF;
%!PS-Adobe-1.0
%%Creator: makeup
%%Title: Page Layout Test
%%CreationDate: $date
%%Pages: (atend)
%%DocumentFonts: Times-Roman
%%BoundingBox: 0 0 612 792
%%EndComments
/inch {72 mul} def
/Nfont /Times-Roman findfont 5 inch scalefont def
/drawpage {
	2 setlinecap 3 setlinewidth 0 setgray
	Nfont setfont
	dup stringwidth
	11 inch exch sub 2 div
	exch 8.5 inch exch sub 2 div
	exch moveto show
	0.25 inch dup moveto
	8 inch 0 rlineto
	0 10.5 inch rlineto
	-8 inch 0 rlineto
	0 -10.5 inch rlineto
	closepath stroke
	showpage
} def
%%EndProlog
EOF

for ($page=1;$page <= $count;$page++) {
	print "%%Page: ? $page\n($page) drawpage\n";
}

print <<EOF;
%%Trailer
%%Pages: $count
EOF
exit(0);
