home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / misc / 5020 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.3 KB

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