diff options
Diffstat (limited to 'extras')
| -rw-r--r-- | extras/mkocrpdf.sh | 9 | ||||
| -rw-r--r-- | extras/mkocrtxt.sh | 7 | ||||
| -rwxr-xr-x | extras/mkpdf.sh | 5 | 
3 files changed, 15 insertions, 6 deletions
| diff --git a/extras/mkocrpdf.sh b/extras/mkocrpdf.sh index 1ec9a06..9d281db 100644 --- a/extras/mkocrpdf.sh +++ b/extras/mkocrpdf.sh @@ -9,9 +9,12 @@  #       script does that, then reduces the results back down  #       to create a reasonable size PDF. +test $# -ne 1 && echo "Usage: $0 bookdir" && exit 1 +cd "$1" || exit 1 +  echo 'tessedit_create_hocr 1' > hocr -for i in `ls *png` +for i in `ls`  do  	echo "$i" @@ -42,8 +45,8 @@ do  	rm -f "$i.big.tif" "$i.big.tif.html" "$i.html"  done -echo book.pdf -  # cat the pdf pages together  pdftk *pdf cat output book.pdf  rm -f [0-9]*pdf hocr + +echo "$1/book.pdf" diff --git a/extras/mkocrtxt.sh b/extras/mkocrtxt.sh index 497f8a7..62f95a4 100644 --- a/extras/mkocrtxt.sh +++ b/extras/mkocrtxt.sh @@ -11,7 +11,10 @@  #       converted to tiff format, so that they're readable by  #       any version of tesseract. -for i in `ls *png` +test $# -ne 1 && echo "Usage: $0 bookdir" && exit 1 +cd "$1" || exit 1 + +for i in `ls`  do  	echo "$i" @@ -30,4 +33,4 @@ do  	rm -f "$i.big.tif" "$i.txt"  done -echo book.txt +echo "$1/book.txt" diff --git a/extras/mkpdf.sh b/extras/mkpdf.sh index cbfcd1b..a2ba2c7 100755 --- a/extras/mkpdf.sh +++ b/extras/mkpdf.sh @@ -3,4 +3,7 @@  #  # Requires imagemagick -convert *.png book.pdf +test $# -ne 1 && echo "Usage: $0 bookdir" && exit 1 + +cd "$1" && convert * book.pdf +echo "$1/book.pdf" | 
