Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jun 1996 22:10:16 -0600
From:      Sean Kelly <kelly@fsl.noaa.gov>
To:        tcg@ime.net
Cc:        questions@freebsd.org
Subject:   Re: Postscript conversion
Message-ID:  <199606040410.EAA06403@gatekeeper.fsl.noaa.gov>
In-Reply-To: <31B39EB6.8A@ime.net> (message from Gary Chrysler on Mon, 03 Jun 1996 22:25:58 -0400)

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> "Gary" == Gary Chrysler <tcg@ime.net> writes:

    Gary> So is there any other way I can convert postscript files to
    Gary> ascii?  I would really like to read the socks manual!

Converting PostScript to ASCII is three factors of magnitude (tm)
harder than the halting problem!  And it's NP-complete, too!  :-)

Seriously, in general it can't be done.  After all, if you've got
PostScript code that draws out each letter through a thousand or so
moveto/lineto/arcto sequences, on paper it may look fine, but there's
little hope of extracting just the text out of that.

Knowing what produced the PostScript code can be a big help, though.
Some programs exist that recognize the PostScript produced by various
document packages and wade its way through the font changes and kerns,
revealing plain old text.

And yes, Ghostscript is your friend. :-)

Seriously, your best bet is to install Ghostscript.  Right, I hear you
... you don't wanna install X windows ... after all, Marcus J Ranum of
DEC said:

	If the designers of X Windows built cars, there would be no
	fewer than five steering whells hidden about the cockpit, none
	of which followed the same principles---but you'd be able to
	shift gears with your car stereo.  Useful feature, that.

So, you'll be happy to note that Ghostscript doesn't need X windows!
Just avoid the copy that's in the ports collection (which I'm assuming
is configured for X by default) and build and install it yourself.  In
fact, I've made sure that ``The Professor'' knows that it worked
out-of-the-box on FreeBSD ... that was back in version 3.33, and I'm
sure it's still true today in version 3.53.

So, grab these files:

  ftp://ftp.cs.wisc.edu/pub/ghost/aladdin/ghostscript-3.53.tar.gz
  ftp://ftp.cs.wisc.edu/pub/ghost/aladdin/ghostscript-3.53jpeg.tar.gz

And in the makefile, explictly leave OUT the X windows stuff!  The
README and make.doc files will certainly provide you with more hints.

Once you've got it built and installed, you'll have a new script to
play with: /usr/local/bin/ps2ascii, which uses gs to extract text out
of PS files.

GOOD LUCK!

-- 
Sean Kelly                          
NOAA Forecast Systems Laboratory    kelly@fsl.noaa.gov
Boulder Colorado USA                http://www-sdd.fsl.noaa.gov/~kelly/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606040410.EAA06403>