home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume8 / up / makeup < prev    next >
Text File  |  1989-10-28  |  1KB  |  55 lines

  1. #!/usr/bin/perl
  2. # test page printing for up.  print arg pages, each with a box around
  3. # the edges (.25 inches in), and the page number in large type.
  4. #  This is useful for debugging page layouts, as well as just wasting
  5. # paper.
  6. #
  7. # usage: makeup count
  8. #
  9. # jgreely@cis.ohio-state.edu, 89/10/23
  10. #
  11. $count = $ARGV[0];
  12. die "usage: makeup count\n" unless $count > 0;
  13.  
  14. $date = `date`;
  15. chop($date);
  16.  
  17. print <<EOF;
  18. %!PS-Adobe-1.0
  19. %%Creator: makeup
  20. %%Title: Page Layout Test
  21. %%CreationDate: $date
  22. %%Pages: (atend)
  23. %%DocumentFonts: Times-Roman
  24. %%BoundingBox: 0 0 612 792
  25. %%EndComments
  26. /inch {72 mul} def
  27. /Nfont /Times-Roman findfont 5 inch scalefont def
  28. /drawpage {
  29.     2 setlinecap 3 setlinewidth 0 setgray
  30.     Nfont setfont
  31.     dup stringwidth
  32.     11 inch exch sub 2 div
  33.     exch 8.5 inch exch sub 2 div
  34.     exch moveto show
  35.     0.25 inch dup moveto
  36.     8 inch 0 rlineto
  37.     0 10.5 inch rlineto
  38.     -8 inch 0 rlineto
  39.     0 -10.5 inch rlineto
  40.     closepath stroke
  41.     showpage
  42. } def
  43. %%EndProlog
  44. EOF
  45.  
  46. for ($page=1;$page <= $count;$page++) {
  47.     print "%%Page: ? $page\n($page) drawpage\n";
  48. }
  49.  
  50. print <<EOF;
  51. %%Trailer
  52. %%Pages: $count
  53. EOF
  54. exit(0);
  55.