Skip to content

Instantly share code, notes, and snippets.

@lionelyoung
Created May 22, 2010 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lionelyoung/409750 to your computer and use it in GitHub Desktop.
Save lionelyoung/409750 to your computer and use it in GitHub Desktop.
Converts an image to PDF. Useful for making PDF images for use in Latex.
#!/bin/bash
if [ ! -f "$1" ] ; then
echo "Input file $1 doesn't exist"
exit 1
fi
TITLE=${1%%.*}
#echo $TITLE
mogrify -format eps $1 && epstopdf $TITLE.eps
echo Conversion of $TITLE done!
if [ -f $TITLE.eps ] ; then
rm -v $TITLE.eps
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment