ps2ascii - Aladdin Ghostscript version 3.N PostScript or PDF to ASCII translator
SYNOPSIS
ps2ascii
ps2ascii
DESCRIPTION
ps2ascii extracts ASCII text from PostScript or PDF, using gs(1). If the
pathname "input.ps" is not specified, PostScript is read from standard input;
PDF input must come from an explicitly-named file, not standard input. If the
pathname "output.txt" is not specified, the ASCII text is written to standard
output.
ps2ascii doesn't look at font encoding, and isn't very good at dealing with
kerning, so for dealing with PostScript (but not currently PDF), you might
consider pstotext(1).