Re: Postscript Viewer for Text Mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello John,

I can tell you about two programs. I use both in debian and both
simply do the job for me. They even read strange pdf files that i
can't open with acrobat 6 with accessibility for win. Both of them use
ghostscript. GNU ghostscript has a GPL
license. (www.gnu.org/directory/ghostscript.html). There's also ADFL
gs which has a slightly different license.

1 - the first one, ps2ascii, is very simple, and works well for
me. It's included in ghostscript (debian package gs-common).

#!/bin/sh
# $RCSfile: ps2ascii,v $ $Revision: 1.2.2.1 $
# 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.

trap "rm -f _temp_.err _temp_.out" 0 1 2 15

OPTIONS="-q -dNODISPLAY -dSAFER -dNOBIND -dWRITESYSTEMDICT -dSIMPLE"
if ( test $# -eq 0 ) then
	gs $OPTIONS -c save -f ps2ascii.ps - -c quit
elif ( test $# -eq 1 ) then
	gs $OPTIONS -c save -f ps2ascii.ps $1 -c quit
else
	gs $OPTIONS -c save -f ps2ascii.ps $1 -c quit >$2
fi

2 - pstotext is a bit more sophisticated and tries to do better
formatting. Debian package: pstotext. 
http://www.cs.wisc.edu/~ghost/doc/pstotext.htm.
It's not a GPL licence, but is should be similar; otherwise why did
good precise debian folks put it in the main distribution?

leo


_______________________________________________

Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list

[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]