Created
December 10, 2018 07:08
-
-
Save nongio/936b52294e0277108075cdaca856c46e 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
pdftk infile.pdf burst output $tmpdir/page_%03d.pdf | |
page=0 | |
imagetype="png" | |
for file in $tmpdir/*.pdf | |
do | |
image=$file.$imagetype | |
convert -density $density -depth $depth $file $image | |
rm $file | |
page=`expr $page + 1` | |
tessoptions="--tessdata-dir "$tessdatadir" -l "$language" pdf" | |
tesseract $image $image $tessoptions | |
rm $image | |
done | |
pdftk $tmpdir/*.pdf cat output $tmpdir/tmp.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment