Created
April 8, 2018 12:11
-
-
Save smhr/634d8764ef6deac711a417133e17d9c5 to your computer and use it in GitHub Desktop.
Reduce the size of pdf files in the current directory.
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
mkdir ./big_pdfs | |
mkdir ./small_pdfs | |
for F in `ls *.pdf`; do | |
echo $F | |
smallPDF="./small_pdfs/$F" | |
echo $newPDF | |
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sOutputFile=$smallPDF $F | |
done | |
# /screen – Lowest quality, lowest size | |
# /ebook – Moderate quality | |
# /printer – Good quality | |
# /prepress – Best quality, highest size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment