Created
April 13, 2013 19:59
-
-
Save kpdecker/5379839 to your computer and use it in GitHub Desktop.
pdf-to-tiff
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 | |
# Converts PDF files to TIFF files suitible for antiquated systems. | |
# Usage: | |
# $ pdf-to-tiff.sh file1 file2 | |
# | |
# Installation: | |
# $ brew install ghostscript | |
# $ brew install libtiff | |
# $ brew install --fresh --build-from-source imagemagick --with-libtiff | |
# | |
for file in $@; do | |
dir=tiff_${file%.pdf} | |
mkdir $dir | |
echo "Converting $file to $dir" | |
for page in `identify $file | sed -e 's/\].*$/\]/'`; do | |
convert -format "tiff" -density 72 -compress lzw -depth 8 -colorspace Gray "$page" "$dir/%d.tif" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment