Created
August 5, 2015 06:15
-
-
Save jesusgoku/a02d351798f33e5977c1 to your computer and use it in GitHub Desktop.
Extract first page from PDF files and convert to JPEG
This file contains hidden or 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 | |
for f in *.pdf; do | |
PDF_OUPUT=`echo "$f"| sed 's/\.pdf$/_0.pdf/'` | |
JPEG_OUPUT=`echo "$f"| sed 's/\.pdf$/.jpeg/'` | |
pdftk "$f" cat 1 output "$PDF_OUPUT" | |
convert -trim "$PDF_OUPUT" "$JPEG_OUPUT" | |
rm -f "$PDF_OUPUT" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment