File: htdig-pdfparser

package info (click to toggle)
htdig 1%3A3.2.0b6-21
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 21,292 kB
  • sloc: ansic: 49,632; cpp: 46,468; sh: 17,400; xml: 4,180; perl: 2,543; makefile: 888; php: 79; asm: 14
file content (37 lines) | stat: -rw-r--r-- 846 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

# Wrapper script for the ht://Dig PDF parser engine
#
# This script is called by the htdig binary to parse pdf documents
# Set the debian_pdf_parsed in the htdig configuration
# 
# 
# Written by Stijn de Bekker <stijn@debian.org> for Debian GNU/Linux.


#PARSER=`grep debian_pdf_parser /etc/htdig/htdig.conf | awk '{ print $2 }'
# replaced with the following line, suggestion by pod, should fix #196916
PARSER=`awk '/^debian_pdf_parser:/{ print $2 }' /etc/htdig/htdig.conf`
PDFFILE=$1
PSFILE=$2

if [ "$PDFFILE" = "" -o "$PSFILE" = "" ]; then
	# Missing .pdf or .ps file
	exit 1
fi

case "$PARSER" in
	acrobat|acroread)
		if [ -x /usr/bin/acroread ]; then
			/usr/bin/acroread -toPostscript $PDFFILE $PSFILE
		fi
		;;

	xpdf|pdftotext)
		if [ -x /usr/bin/pdftotext ]; then
			/usr/bin/pdftotext $PDFFILE $PSFILE
		fi
		;;
esac

exit 0