home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / alt / hackers / 1847 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  1.9 KB

  1. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!news.Brown.EDU!news.brown.edu!jgm
  2. From: jgm@cs.brown.edu (Jonathan Monsarrat)
  3. Newsgroups: alt.hackers
  4. Subject: Re: ps to ascii?
  5. Date: 22 Dec 92 09:53:08
  6. Organization: Dept. of Computer Science, Brown University
  7. Lines: 44
  8. Approved: :devorppA
  9. Message-ID: <JGM.92Dec22095308@vegas.cs.brown.edu>
  10. References: <1fnnckINN84g@matt.ksu.ksu.edu>
  11. NNTP-Posting-Host: vegas.cs.brown.edu
  12. In-reply-to: holland@matt.ksu.ksu.edu's message of 4 Dec 1992 07:44:52 -0600
  13.  
  14.  
  15. > converting PS documents to vanilla ASCII.
  16.  
  17. Use this or use gs2_asc from GhostScript. I have a copy of gs2asc if
  18. you need one. There is a newsgroup comp.lang.postscript (and a FAQ)
  19. for such things.
  20.  
  21. There is a PostScript programming contest going on for hackers. Check
  22. it out in wilma.cs.brown.edu:pub/postscript/rules.ps  (or rules.txt)
  23.  
  24. -Jon
  25. %! Jon Monsarrat   jgm@cs.brown.edu   Brown University %! ObHack PostScript:
  26. (LcHdBidZi_hdQ6[PaVa1b4c6F"J4b/>$O<)(di_zk{:UFfUg;ABF)(2n>]Eh:u?<)(P"M#R\(:$T<)
  27. ([gXfSZ]f\\dZbeZeb^fH;`?dR=ZS7)(K P!U!: H<)(9l9cCf:o?$)(7W4]6`:X;=)(U"W#_%:"R-)
  28. (A 5"<&Y%K"F"M,M,S\)i3e.M5F_PZR9>lP-)(wBxEuEs7x;uBq:q<q>hFh7o:=Nj<)(Z#]#b#:$R-)
  29. (m+m+k3S!R+d,;"^<)(GFP\\RamZf;TAP{X{fd<{C7)(4840N2:6N=)([ Z#^&:!c<)(<%?$C$:#8<)
  30. (D!J"L#:!B<)/a{def}def/M{exch}a/S{repeat}a/Q{{40 add}if}a 18{{}forall/R M a/x 2
  31. /y 3/z 5 3{R M mod 1 eq a}S x Q M y Q moveto 57 sub{3{y Q M x Q M 6 2 roll}S
  32. curveto}S z{fill}{stroke}ifelse}S showpage
  33.  
  34.  
  35. #! /usr/local/bin/perl -P
  36. ########################################################
  37. # ps2ascii: look through a PostScript file for ASCII strings
  38. #
  39. # Usage:
  40. #     ps2ascii <inputfile.ps>
  41. #
  42. ########################################################
  43.  
  44. $out = "";
  45. while(<>)
  46. {
  47.   $line = $_;
  48.   while($line =~/\((.*)\)(.*)/) {
  49.        $line = $2;
  50.        if(length($out)+length($1) > 76) {
  51.          print "$out\n";
  52.          $out="";
  53.        }
  54.        $out=$out." ".$1;
  55.   }
  56. }
  57. print "$out\n";
  58.