home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / laser / postprn.arc / LAND2.PS < prev    next >
Text File  |  1989-06-09  |  2KB  |  136 lines

  1. %!
  2.  
  3. %
  4. % Two-Up Landscape Page Printer
  5. %
  6.  
  7. /inch {72 mul} def
  8. /pageheight 11 inch def
  9. /pagewidth 8.5 inch def
  10.  
  11. /tp0 pageheight .3 inch sub def
  12. /bp0 5.6 inch def
  13. /tp1 5.4 inch def
  14. /bp1 .3 inch def
  15.  
  16. /lmarg .3 inch def
  17. /tmarg tp0 def
  18. /bmarg bp0 def
  19.  
  20. /lincr 5.6 def
  21.  
  22. /x lmarg def
  23. /y tmarg def
  24. /pg 0 def
  25.  
  26. /xw 0 def
  27. /yw 0 def
  28. /i currentfile def
  29. /s 1000 string def
  30. /ones 1 string def
  31. /lastFF 0 def
  32. /page_text 0 def    % no text on this page
  33.  
  34. /undershow
  35. {
  36.     currentlinewidth exch
  37.     dup show   currentpoint 3 2 roll
  38.     stringwidth exch neg exch
  39.     0 -1.5 rmoveto   rlineto 0.4 setlinewidth stroke
  40.     moveto setlinewidth
  41. } def
  42.  
  43. /dolines
  44. {
  45.     gsave
  46.     .1 setlinewidth
  47.     newpath
  48.         .2 inch 5.5 inch moveto
  49.         10.8 inch 5.5 inch lineto
  50.         stroke
  51.     grestore
  52. } def
  53.  
  54.  
  55. /doFF
  56. %
  57. % Takes 2 arguments:
  58. %
  59. %        Top: Type of FF encountered (0 = whatever 1=char 2=margin)
  60. %        Next: Force showpage anyways?
  61. %
  62. {
  63.     /curFF exch def
  64.     1 eq
  65.     {
  66.         dolines
  67.         showpage
  68.         /page_text 0 def
  69.         /x lmarg def
  70.         /y tmarg def
  71.         /xw 0 def
  72.         /yw 0 def
  73.     }
  74.     {
  75.                 %
  76.                 % if FF right after last line on page, ignore FF
  77.                 %
  78.         curFF 1 eq                % This is FF?
  79.         lastFF 2 eq                % Last was type 2 -- margin
  80.         x lmarg eq                % Still at left margin
  81.         y tmarg eq                % Still at top margin
  82.         and and and false eq    % Do it if all the above is false
  83.         {
  84.             pg 0 eq
  85.             {
  86.                 /pg 1 def
  87.                 /tmarg tp1 def
  88.                 /bmarg bp1 def
  89.             }
  90.             {
  91.                 dolines
  92.                 showpage
  93.                 /page_text 0 def
  94.                 /pg 0 def
  95.                 /tmarg tp0 def
  96.                 /bmarg bp0 def
  97.             } ifelse
  98.             /x lmarg def
  99.             /y tmarg def
  100.             /xw 0 def
  101.             /yw 0 def
  102.         } if
  103.     } ifelse
  104.     x y moveto
  105.     /lastFF curFF def
  106. } def
  107.  
  108. /normal-font /Courier findfont 7 scalefont def
  109. /bold-font /Courier-Bold findfont 7 scalefont def
  110. /italic-font /Courier-Oblique findfont 7 scalefont def
  111. /bolditalic-font /Courier-BoldOblique findfont 7 scalefont def
  112. /isbold 0 def
  113. /isitalic 0 def
  114.  
  115. /lineprint
  116. {
  117.     normal-font setfont
  118.     {i s readline
  119.         {
  120.             x y moveto
  121.             showline
  122.             /x lmarg def
  123.             /y y lincr sub def
  124.             y bmarg lt
  125.             { 0 2 doFF } if
  126.         }
  127.         {
  128.             page_text 1 eq
  129.             {1 0 doFF} if
  130.             exit
  131.         } ifelse
  132.     } loop
  133. } def
  134.  
  135. lineprint
  136.