🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #2088

Re: ASCII-->POSTSCRIPT (need PS program, not unix, not ibm)

#2088
From: Charles B. Cranston
Date: Fri, 04 Sep 1992 00:06
61 lines
2471 bytes
In article <16566@ucdavis.ucdavis.edu>,
ccm038@othello.ucdavis.edu (Jason Yan (can cook)) wrote:

> ...I need a poscript program that I can append text to
> and have it print on a PS printer without goofing up.

OK, here is the solution for the "left to the reader" problem of
modifying what I posted earlier to work with PS printers that
insist upon turning LF into CR...

%!-Adobe-1.0
%%Title: asciiprint.ps
%%Creator: Ben Cranston <zben@umd2.umd.edu>
%%CreationDate: Thu Feb 8 1990
%%Pages 0

/Courier findfont 10 scalefont setfont
/colwid (m) stringwidth pop def
36 756 moveto
256 string
{ %exec
   { %loop over file
      dup currentfile exch readstring exch
      { %loop FF
         (\f) search exch
         { %loop NEWLINE
            (\r) search exch
            { %loop TAB
               (\t) search exch
               { %loop BS
                  (\b) search exch
                  show
                  not { exit } if
                  pop currentpoint exch colwid sub exch moveto
               } loop %BS
               not { exit } if
               pop currentpoint exch 36 sub colwid div .49 add cvi
               8 add dup 8 mod sub colwid mul 36 add exch moveto
            } loop %TAB
            not { exit } if
            pop 36 currentpoint exch pop
            11 sub dup 25 le { %if
               pop showpage 756
            } if
            moveto
         } loop %NEWLINE
         not { exit } if
         pop showpage 36 756 moveto
      } loop %FF
      not { exit } if
   } loop %over file
   pop showpage
} bind exec

The tab code has been changed to make it more readable and modifiable.
The two 8s are the tab stops, you should be able to change them to any
other number.  The only other change is the indentation at three should
be a tad more readable than the old indentation at two.


zben@ni.umd.edu     -KA3ZDF
Technical Details
Message-ID: <zben-030992200210@zben-mac-ii.umd.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!haven.umd.edu!ni.umd.edu!zben-mac-ii.umd.edu!user
References: <16566@ucdavis.ucdavis.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!haven.umd.edu!ni.umd.edu!zben-mac-ii.umd.edu!user
From: zben@ni.umd.edu (Charles B. Cranston)
Newsgroups: comp.lang.postscript
Subject: Re: ASCII-->POSTSCRIPT (need PS program, not unix, not ibm)
Message-ID: <zben-030992200210@zben-mac-ii.umd.edu>
Date: 4 Sep 92 00:06:47 GMT
References: <16566@ucdavis.ucdavis.edu>
Sender: usenet@ni.umd.edu (USENET News System)
Followup-To: comp.lang.postscript
Organization: UM Home for the Terminally Analytical
Lines: 61
Nntp-Posting-Host: zben-mac-ii.umd.edu