Created
March 26, 2018 14:18
-
-
Save banjeremy/16abf58a15544ad5975dec54dba16f12 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=merged.pdf **.pdf | |
# jpg to pdf | |
ls *.JPG | xargs -I% convert % -quality 100 %.pdf | |
# compress them | |
ls *.pdf | xargs -I% gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed_% % | |
# resize | |
ls compressed_*.pdf | xargs -I@ convert -density 100x100 -quality 45 -resize 50% -compress jpeg @ resized_@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment