π¦ ClawHub
pdf-compress-tool
by @johnsonklose
Compress PDF files to a target size or by percentage, using a Ghostscript + pikepdf + QPDF multi-stage pipeline.
π‘ Examples
Compress to target size
"Compress this PDF to under 2MB"
"Compress this PDF to under 5MB"
python compress_pdf.py report.pdf --target-size 2MB
Compress by percentage
"Reduce the file size by 30%"
"Reduce the file size by 50%"
python compress_pdf.py report.pdf --reduce 30
Specify output path and quality
python compress_pdf.py report.pdf --reduce 50 --quality low -o small.pdf
Batch processing
"Compress all PDFs in the papers folder to under 2MB"
python compress_pdf.py --batch ./papers --target-size 2MB
python compress_pdf.py --batch ./papers --reduce 40 --quality high
TERMINAL
clawhub install pdf-compress-tool