Skip to content

Instantly share code, notes, and snippets.

@anhhh11
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anhhh11/11140498 to your computer and use it in GitHub Desktop.
Save anhhh11/11140498 to your computer and use it in GitHub Desktop.
gs -sDEVICE=tiffgray -dNOPAUSE -r300 -sOutputFile="o-%04d.tiff" ./ttnt.pdf -c quit
for i in *.tif ; do tesseract $i $i -l vie -psm 1 ; done
mkdir done
for i in *.tiff;do if [ -f $i.txt ];then mv $i.txt done/;mv $i done/;fi;done
gs -sDEVICE=jpeg -dJPEGQ=100 -dNOPAUSE -r300 -sOutputFile="o-%04d.jpeg" ./ttnt.pdf -q -c quit
for i in done/*.txt; do j="`basename -s .tiff.txt $i`.jpeg";if [ -f $j ];then rm -f $j;fi; done
for i in *.jpeg ; do tesseract $i $i -l vie; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment