-
-
Save brunogama/9202477cd90050668bac3262f45e9561 to your computer and use it in GitHub Desktop.
convert vector pdf to iOS image assets
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 -e | |
# convert vector pdf to iOS image assets | |
# copy this script to the folder where the pdf files live and run "./convertPDFToPNG3x.sh" in terminal. | |
# this will generate [filename]@3x.png, [filename]@2x.png and [filename].png images in the same folder | |
# Ensure we're running in location of script. | |
cd "`dirname $0`" | |
for f in *; do | |
if [[ $f == *.pdf ]]; | |
then | |
convert -density 216 "$f" "${f//.pdf/@3x.png}" | |
convert -density 144 "$f" "${f//.pdf/@2x.png}" | |
convert -density 72 "$f" "${f//.pdf/.png}" | |
fi | |
done | |
echo "Complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment