Skip to content

Instantly share code, notes, and snippets.

@previtus
Last active August 18, 2024 16:44
Show Gist options
  • Save previtus/b2ec341c4a637524b96a9073476d8a86 to your computer and use it in GitHub Desktop.
Save previtus/b2ec341c4a637524b96a9073476d8a86 to your computer and use it in GitHub Desktop.
Compress pdfs in folder!
for i in *.pdf ; do ps2pdf "$i" "${i%.*}c.pdf" ; done
# for examle this goes from 15.7 MB to 3.9 MB ... without really visibly loosing quality!
source : 2.4 MB (plot from matplotlib)
https://github.com/pts/pdfsizeopt
- slow!
- default command 2.2MB
- running on the ps2pdf result - just a tiny bit smaller to 479kb
https://smallpdf.com/compress-pdf#r=compress
- limited, loss of quality too large
- 57kb
ps2pdf conversion
- fast!
- 481kb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment