more filter cleanup: factorize code in the vanilla xslt ones, move a few more to python.
This commit is contained in:
+15
-16
@@ -17,11 +17,11 @@
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#
|
||||
# Extract text from a dvi file by either executing dvitops and rclps
|
||||
# or using catdvi. dvitops has given better results during tests, and is
|
||||
# chosen first if available, but the dvitops/rclps combination is much
|
||||
# slower than catdvi
|
||||
# set variables
|
||||
# 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)
|
||||
LANG=C ; export LANG
|
||||
LC_ALL=C ; export LC_ALL
|
||||
progname="rcldvi"
|
||||
@@ -94,26 +94,25 @@ umask 77
|
||||
# !! Leave the following line unmodified !
|
||||
#ENDRECFILTCOMMONCODE
|
||||
|
||||
# Find rclps. Note: this only works because we are always executed with a
|
||||
# full path
|
||||
rclps=`dirname $0`/rclps
|
||||
|
||||
decoderdvips()
|
||||
{
|
||||
dvips -f $1 2> /dev/null | pstotext | iconv -f cp1252 -t utf-8 -c -s
|
||||
}
|
||||
decodercatdvi()
|
||||
{
|
||||
catdvi $1
|
||||
}
|
||||
decoder=""
|
||||
if iscmd dvips -a iscmd pstotext ; then
|
||||
decoder=dvips
|
||||
decoder=decoderdvips
|
||||
elif iscmd catdvi ; then
|
||||
decoder=catdvi
|
||||
decoder=decodercatdvi
|
||||
fi
|
||||
|
||||
if test X$decoder = X ; then
|
||||
senderror HELPERNOTFOUND dvips or catdvi
|
||||
fi
|
||||
|
||||
if test X$decoder = Xdvips ; then
|
||||
$decoder -f < "$infile" 2> /dev/null | $rclps -
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# The strange 'BEGIN' setup is to prevent 'file' from thinking this file
|
||||
# is an awk program
|
||||
$decoder "$infile" |
|
||||
|
||||
Reference in New Issue
Block a user