[ale] Postscript to text?

Greg Hankins gregh at cc.gatech.edu
Thu Aug 8 10:52:34 EDT 1996


Steven A. Duchene writes:
>Is there a tool that will convert postscript to straight text (i.e. just
>extract the text out of the file)?

We had this lying around:

#!/bin/sh -f
# Extract ASCII text from a PostScript file.  Usage:
#       ps2ascii [infile.ps [outfile.txt]]
# If outfile is omitted, output goes to stdout.
# If both infile and outfile are omitted, ps2ascii acts as a filter,
# reading from stdin and writing on stdout.
if ( test $# -eq 0 ) then
        gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE ps2ascii.ps - quit.ps
elif ( test $# -eq 1 ) then
        gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE ps2ascii.ps $1 quit.ps
else
        gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE ps2ascii.ps $1 quit.ps >$2
fi

You'll need gs.  You should have quit.ps and ps2ascii.ps installed with
gs.  The output isn't great, but it's usable.  I happen to know this,
because one of our users here just asked the same thing.  Coincidence?
Or is it my day to be helpful... :-).

Greg

-- 
Greg Hankins (greg.hankins at cc.gatech.edu)  |  Georgia Institute of Technology
Computing and Networking Services          |  College of Computing, room 213
+1 404 894 6609                            |  Atlanta, GA 30332-0280 
Greg Hankins
finger gregh at cc.gatech.edu for PGP key






More information about the Ale mailing list