Created
January 11, 2022 17:29
-
-
Save even4void/c301baf74a372cb8fc761769bdd14c30 to your computer and use it in GitHub Desktop.
Convert page from a PDF to a PNG
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
#!/usr/bin/env bash | |
# Note: pdftoppm has page range so the first line is probably not necessary. | |
f="/tmp/tmp.$RANDOM" | |
pdftk "$1" cat $2 output $f | |
pdfcrop $f $f.crop | |
pdftoppm -png -rx 300 -ry 300 $f.crop $HOME/"$1".png | |
rm $f $f.crop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment