Powerpoint docs: add option to have rclppt use unoconv

This commit is contained in:
Jean-Francois Dockes 2013-11-12 09:56:50 +01:00
parent a1f58fa057
commit a9358d2f03

View File

@ -30,6 +30,7 @@ LC_ALL=C ; export LC_ALL
progname="rclppt" progname="rclppt"
filetype=powerpoint filetype=powerpoint
RCLPPT_CATPPT=${RCLPPT_CATPPT:=yes}
#RECFILTCOMMONCODE #RECFILTCOMMONCODE
############################################################################## ##############################################################################
@ -97,6 +98,7 @@ umask 77
# !! Leave the following line unmodified ! # !! Leave the following line unmodified !
#ENDRECFILTCOMMONCODE #ENDRECFILTCOMMONCODE
if test X$RCLPPT_CATPPT = Xyes ; then
checkcmds catppt checkcmds catppt
# output the result # output the result
@ -114,3 +116,36 @@ echo '</body></html>'
# exit normally # exit normally
exit 0 exit 0
else
# Using unoconv
checkcmds unoconv pdftotext
# This needs a temp dir because we first output pdf (outputting html
# would produce one file per page), and pdftotext can't read from
# stdin
if test z"$RECOLL_TMPDIR" != z; then
ttdir=$RECOLL_TMPDIR
elif test z"$TMPDIR" != z ; then
ttdir=$TMPDIR
else
ttdir=/tmp
fi
tmpdir=$ttdir/rclppt_tmp$$
mkdir $tmpdir || exit 1
mkdir $tmpdir/rclppttmp || exit 1
unopdf=$tmpdir/rclppttmp/output.pdf
cleanup()
{
# Note that we're using a constant part (rclkwdtmp), that hopefully
# guarantees that we can't do big mistakes here.
rm -rf $tmpdir/rclppttmp
rmdir $tmpdir
}
trap cleanup EXIT HUP QUIT INT TERM
unoconv -f pdf -o $unopdf "$infile"
`dirname $0`/rclpdf $unopdf
fi