pstotext does not work with recent ghostscript versions. Use catdvi instead of dvips+pstotext for dvi, and ps2pdf+pdftotext for postscript

This commit is contained in:
Jean-Francois Dockes
2018-11-20 15:12:36 +01:00
parent 6f1be83251
commit 0df4c06e85
4 changed files with 129 additions and 16 deletions
+26 -15
View File
@@ -18,10 +18,15 @@
#
# Extract text from a dvi file by either executing dvitops and
# pstotext or using catdvi. dvitops has given better results during
# tests, and is chosen first if available, but the dvitops/pstotext
# combination is much slower than catdvi set variables. In any case,
# the program is not too good with special characters (e.g. ligatures)
# pstotext or using catdvi.
#
# pstotext does not work any more with gs 9.22-25, so catdvi is always
# needed now.
# Initially dvitops had given better results during tests, and was
# chosen first if available, but the dvitops/pstotext combination
# is much slower than catdvi set variables. In any case, the
# program is not too good with special characters (e.g. ligatures)
LANG=C ; export LANG
LC_ALL=C ; export LC_ALL
progname="rcldvi"
@@ -100,21 +105,27 @@ decoderdvips()
}
decodercatdvi()
{
catdvi $1
catdvi --output-encoding=UTF-8 $1
}
decoder=""
iscmd dvips
isdvips=$?
iscmd pstotext
ispstotext=$?
if test $isdvips -eq 0 -a $ispstotext -eq 0; then
decoder=decoderdvips
elif iscmd catdvi ; then
decoder=decodercatdvi
fi
# pstotext does not work any more
# iscmd dvips
# isdvips=$?
# iscmd pstotext
# ispstotext=$?
# if test $isdvips -eq 0 -a $ispstotext -eq 0; then
# decoder=decoderdvips
# elif iscmd catdvi ; then
# decoder=decodercatdvi
# fi
if iscmd catdvi ; then
decoder=decodercatdvi
fi
if test X$decoder = X ; then
senderror HELPERNOTFOUND dvips or catdvi
senderror HELPERNOTFOUND catdvi
fi
# The strange 'BEGIN' setup is to prevent 'file' from thinking this file