Created
April 14, 2017 18:32
-
-
Save khufkens/95e8e093d1a5e68beed23b38cbc12c1a to your computer and use it in GitHub Desktop.
Converts PDF figures to tiff files for publication
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/bash | |
# batch convert pdf to tiff files | |
# takes one argument, resolution in dpi | |
# use: pdf2tiff.sh 150 | |
# will convert all pdfs in the current | |
# directory to tiff files at 150dpi | |
files=`ls *.pdf` | |
for i in $files;do | |
# get the filename without the extension | |
noextension=`echo $i | sed 's/\(.*\)\..*/\1/'` | |
filename=`echo $noextension.tif` | |
echo $filename | |
gs -q -dNOPAUSE -r$1 -sDEVICE=tiff24nc -sCompression=lzw -sOutputFile=$filename $i -c quit | |
done | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment