Created
September 16, 2016 20:31
-
-
Save facholi/87b31d7aaacb39efaf8ad6138c6a801d to your computer and use it in GitHub Desktop.
With a list of object names as argument, this script download each pdf file from AWS S3 and converts the pages to JPG images
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
#!/bin/sh | |
bucket="multiplat-resources-homolog/"; | |
prefix="content/"; | |
while read -r line || [[ -n $line ]]; do | |
echo "downloading file $line"; | |
pdfname=$(echo "$line" | sed 's/-original//'); | |
aws s3 cp s3://$bucket$prefix$line $pdfname.pdf; | |
mkdir $pdfname; | |
echo "generating the pages..."; | |
time gm convert -density 200 -quality 100 -geometry 1300x1300 $pdfname.pdf +adjoin jpg:$pdfname/page%06d | |
echo "done $pdfname."; | |
done < "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment