Created
December 12, 2020 17:37
-
-
Save JamesSaxon/c75bf3aad5ed33d07761873f6ac626c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p images/ | |
if [[ $# -ne 1 ]]; then | |
echo provide the pdf file as a single argument. | |
exit 1 | |
fi | |
f=$1 | |
echo $f | |
o=$(echo $f | sed "s/.pdf//") | |
pdfimages $f images/$o | |
ls images/$o-*ppm > tmp | |
echo "debug_file /dev/null" > quiet.conf | |
tesseract tmp $o.ocr -l eng --dpi 200 pdf txt quiet.conf | |
rm tmp images/$o-* | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment