From owner-freebsd-questions Mon Jun 3 21:10:27 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id VAA12315 for questions-outgoing; Mon, 3 Jun 1996 21:10:27 -0700 (PDT) Received: from gatekeeper.fsl.noaa.gov (gatekeeper.fsl.noaa.gov [137.75.131.181]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id VAA12306 for ; Mon, 3 Jun 1996 21:10:24 -0700 (PDT) Received: from emu.fsl.noaa.gov (kelly@emu.fsl.noaa.gov [137.75.60.32]) by gatekeeper.fsl.noaa.gov (8.7.5/8.7.3) with ESMTP id EAA06403; Tue, 4 Jun 1996 04:10:16 GMT Message-Id: <199606040410.EAA06403@gatekeeper.fsl.noaa.gov> Received: by emu.fsl.noaa.gov (1.40.112.3/16.2) id AA002591416; Mon, 3 Jun 1996 22:10:16 -0600 Date: Mon, 3 Jun 1996 22:10:16 -0600 From: Sean Kelly To: tcg@ime.net Cc: questions@freebsd.org In-Reply-To: <31B39EB6.8A@ime.net> (message from Gary Chrysler on Mon, 03 Jun 1996 22:25:58 -0400) Subject: Re: Postscript conversion Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >>>>> "Gary" == Gary Chrysler 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/