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

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