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

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