Created
November 7, 2015 12:34
-
-
Save maakuth/ec54196bf54e393effd5 to your computer and use it in GitHub Desktop.
Shell utility script to compress images into reasonably sized PDFs
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/sh | |
if [ $# -eq 0 ] | |
then | |
echo "Usage $0 img1.png img2.tif img3.pdf" | |
echo "Requires ghostscript, imagemagick" | |
fi | |
for file in "$@" | |
do | |
convert "$file" "$file.pdf" | |
pdf2ps "$file.pdf" | |
rm "$file.pdf" | |
ps2pdf "$file.ps" "${file%.*}.pdf" | |
rm "$file.ps" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment