Last active
January 28, 2020 09:32
-
-
Save dira/d172776adaef81876df7b519fe32b64c to your computer and use it in GitHub Desktop.
Convert a pdf (table with text) to very readable jpgs, one per pdf page
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
# install gs (Ghostscript) | |
# install ImageMagick | |
# add to ~/.bash_profile: | |
pdf_to_jpg () { | |
filename=${1:-5} | |
precision=${2:-1} | |
convert -density 150 $filename -background white -alpha background -alpha off +adjoin -quality 100 -sharpen 0x1.0 "${filename%.*}-%0${precision}d.jpg" | |
} | |
# and then you can | |
> pdf_to_jpg any.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment