Skip to content

Instantly share code, notes, and snippets.

@amandeepjutla
Created February 1, 2018 00:27
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 amandeepjutla/0c831b46e871a72c572523df6f6930ba to your computer and use it in GitHub Desktop.
Save amandeepjutla/0c831b46e871a72c572523df6f6930ba to your computer and use it in GitHub Desktop.
Extract OCRed text from a pdf.
#!/bin/bash
# usage: ocrextract x where x is a pdf file will generate a text file containing x's text
convert -density 300 $1.pdf -depth 8 -alpha OFF $1.tiff
tesseract $1.tiff $1.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment