home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!news.Brown.EDU!news.brown.edu!jgm
- From: jgm@cs.brown.edu (Jonathan Monsarrat)
- Newsgroups: alt.hackers
- Subject: Re: ps to ascii?
- Date: 22 Dec 92 09:53:08
- Organization: Dept. of Computer Science, Brown University
- Lines: 44
- Approved: :devorppA
- Message-ID: <JGM.92Dec22095308@vegas.cs.brown.edu>
- References: <1fnnckINN84g@matt.ksu.ksu.edu>
- NNTP-Posting-Host: vegas.cs.brown.edu
- In-reply-to: holland@matt.ksu.ksu.edu's message of 4 Dec 1992 07:44:52 -0600
-
-
- > converting PS documents to vanilla ASCII.
-
- Use this or use gs2_asc from GhostScript. I have a copy of gs2asc if
- you need one. There is a newsgroup comp.lang.postscript (and a FAQ)
- for such things.
-
- There is a PostScript programming contest going on for hackers. Check
- it out in wilma.cs.brown.edu:pub/postscript/rules.ps (or rules.txt)
-
- -Jon
- %! Jon Monsarrat jgm@cs.brown.edu Brown University %! ObHack PostScript:
- (LcHdBidZi_hdQ6[PaVa1b4c6F"J4b/>$O<)(di_zk{:UFfUg;ABF)(2n>]Eh:u?<)(P"M#R\(:$T<)
- ([gXfSZ]f\\dZbeZeb^fH;`?dR=ZS7)(K P!U!: H<)(9l9cCf:o?$)(7W4]6`:X;=)(U"W#_%:"R-)
- (A 5"<&Y%K"F"M,M,S\)i3e.M5F_PZR9>lP-)(wBxEuEs7x;uBq:q<q>hFh7o:=Nj<)(Z#]#b#:$R-)
- (m+m+k3S!R+d,;"^<)(GFP\\RamZf;TAP{X{fd<{C7)(4840N2:6N=)([ Z#^&:!c<)(<%?$C$:#8<)
- (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
- /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
- curveto}S z{fill}{stroke}ifelse}S showpage
-
-
- #! /usr/local/bin/perl -P
- ########################################################
- # ps2ascii: look through a PostScript file for ASCII strings
- #
- # Usage:
- # ps2ascii <inputfile.ps>
- #
- ########################################################
-
- $out = "";
- while(<>)
- {
- $line = $_;
- while($line =~/\((.*)\)(.*)/) {
- $line = $2;
- if(length($out)+length($1) > 76) {
- print "$out\n";
- $out="";
- }
- $out=$out." ".$1;
- }
- }
- print "$out\n";
-