% Prologue for a -text job. % It assumes psprint has defined land and dev. % Every character after this file (until ^D) will be treated as a printing % character (or control character) instead of being interpreted as PostScript. land { /setlocation % if /landscape { 0 11.7 72 mul translate % shift origin up 11.7in -90 rotate % rotate axes 90deg clockwise 72 0 translate % 1in left margin 0 535 moveto % start of top line /line 0 def % initialize line counter /char 0 def % initialize chars/line counter } bind def /maxline 50 def % maximum lines per page /maxchar 132 def % maximum chars per line /interline -10 def % baseline skip /Courier findfont 9 scalefont setfont % use 9pt Courier } { /setlocation % if no /landscape { 72 0 translate % 1in left margin 0 764 moveto % start of top line /line 0 def % initialize line counter /char 0 def % initialize chars/line counter } bind def /maxline 66 def % maximum lines per page /maxchar 80 def % maximum chars per line /interline -11 def % baseline skip /Courier findfont 10 scalefont setfont % use 10pt Courier } ifelse /formfeed { line 0 gt { showpage setlocation } if } bind def /linefeed { /char 0 def % reset chars/line counter /line line 1 add def % increment line counter line maxline eq % line = max lines per page? { formfeed } % if so, show page { currentpoint pop neg interline rmoveto } % else start next line ifelse } bind def /backspace { /char char 1 sub def char 0 ge { charwidth neg 0 rmoveto } if % move back one character } def /showchar { currentchar 0 thischar put % put thischar into 1-char string /char char 1 add def % increment chars/line counter char maxchar le { currentchar show } if % ignore chars > maxchar } bind def /eachchar { infile read not {exit} if % get next char /thischar exch def % save it in thischar thischar 32 ge % thischar >= space? { showchar } % if so, show it { thischar 8 eq % or does thischar = backspace? { backspace } { thischar 10 eq % or does thischar = linefeed? { linefeed } { thischar 12 eq % or does thischar = formfeed? { formfeed } { % ignore any other control char } ifelse } ifelse } ifelse } ifelse } bind def (%stdin) (r) file /infile exch def /currentchar 1 string def setlocation /charwidth (a) stringwidth pop def /charloop { {eachchar} loop line 0 gt { showpage } if % flush last page if necessary dev (LW) eq { @bannerpage } if % print banner page if LaserWriter } def charloop