Created
January 11, 2013 09:28
-
-
Save imrehg/4509268 to your computer and use it in GitHub Desktop.
Ignite talk conversion from PDF to PNG
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
#!/bin/bash | |
# Put all PDF in a single numbered directory on its own (from 01...) | |
# Change the upper limit here to the number of directories created | |
# Expcet Ignite style talk (that is 20 or so slides) | |
for i in {01..13} | |
do | |
cd $i | |
# find filename | |
name=`find -type f -name "$i*.pdf"` | |
name=${name##*/} | |
name=${name%.pdf} | |
echo ${name} | |
# delete exisiting files | |
for f in ${name}-*.png | |
do | |
[ -f $f ] && rm "$f" | |
done | |
# convert | |
convert "${name}.pdf" "${name}.png" | |
# change numbering | |
for i in {0..9} | |
do | |
mv "${name}-${i}.png" "${name}-0${i}.png" | |
done | |
# back to base | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment