Created
July 30, 2024 20:21
-
-
Save wellington1993/9bbddf3a7cb6db3d60bc78a4d0b66508 to your computer and use it in GitHub Desktop.
Reduce PDF Size
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/bash | |
# Script to compress PDF files, be carefull with signed docs | |
# Original Size: 241M | |
# output.pdf | |
# Reduce PDF Size using QPDF | |
# new size: 217M | |
qpdf --compress-streams=y --object-streams=generate output.pdf output-qpdf.pdf | |
# Reducing using Mutool | |
# new size: 173M | |
mutool clean -gggg -l -z -f -i output-qpdf.pdf output-qpdf-muclean.pdf | |
# Reducing again using qpdf | |
# new size: 160M | |
qpdf --compress-streams=y --object-streams=generate output-qpdf-muclean.pdf output-compressed.pdf | |
# Compressing the resulting PDF | |
# new size: 149M | |
bzip2 -9 output-compressed.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment