Last active
June 4, 2018 03:47
-
-
Save ckunte/822e28d3661cb4fb03be2c298965f1ad to your computer and use it in GitHub Desktop.
Compressing pdf files with ghostscript. (The ebook option, I think, offers the best compression without loss of quality.)
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 | |
# -*- coding: UTF-8 -*- | |
# compress all pdf files in a folder -- 2018 ckunte | |
for i in *.pdf; do gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compr_$i $i; done |
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 sh | |
# ref: https://tex.stackexchange.com/questions/142455/xetex-xdvipdfmx-option-to-reduce-all-graphics-to-300dpi | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=file-compressed.pdf file.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment