home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!decwrl!csus.edu!netcom.com!alm
- From: alm@netcom.com (Andrew Moore)
- Newsgroups: comp.unix.misc
- Subject: Re: post script to text
- Message-ID: <1993Jan27.003928.11177@netcom.com>
- Date: 27 Jan 93 00:39:28 GMT
- Article-I.D.: netcom.1993Jan27.003928.11177
- References: <1993Jan24.171940.63123@cc.usu.edu>
- Organization: Netcom Online Communications Services (408-241-9760 login: guest)
- Lines: 31
-
- In article <1993Jan24.171940.63123@cc.usu.edu> sljn6@cc.usu.edu writes:
- >
- >
- >
- >
- >I wanted to know if there is any freely available
- >software to change post script file to txtt
-
- Sort of. There is a macro as part of the GNU Ghostscript package which
- extract words (which can be reformatted). It's the best I've seen.
-
- Here is a shell script I use with Ghostscript (gs):
-
- #! /bin/sh -
- # ps2ascii - convert postscript text to readable ascii
- #
- # SYNTAX
- # ps2ascii file.ps ...
- # BUGS
- # postscript text generated by dvips causes problems
- #
- PATH=/bin:/usr/bin:/usr/gnu/bin
- TMP=/tmp
- trap 'rm -f $TMP/gs.$$; kill $$' 1 2 3
- cat $* |
- gs -dNODISPLAY -q -dNOBIND -dWRITESYSTEMDICT gs_2asc.ps - quit.ps >$TMP/gs.$$
- sed -n '/^S/s/^S[^(]*(\(.*\))[^)]*$/\1/p' <$TMP/gs.$$ | nroff
- ---- End of Script ----
-
- If you have lots of memory, the TMP file isn't necessary. Hope this help!
- -Andrew Moore <alm@netcom.com>
-