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

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