How to compress pdf using ffmpeg
- User
How to compress pdf using ffmpeg
Assistant
FFmpeg cannot compress PDF files - it's designed for audio and video processing, not document compression.
For PDF compression, you'll want to use tools specifically designed for that purpose:
Command-line options:
- Ghostscript:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed.pdf input.pdf - qpdf:
qpdf --linearize input.pdf compressed.pdf - ImageMagick:
convert -density 150 -compress jpeg -quality 85 input.pdf compressed.pdf
GUI options:
- Adobe Acrobat (paid)
- Preview on macOS (built-in)
- Various online PDF compressors
The Ghostscript command above is particularly effective - the
-dPDFSETTINGSparameter can be set to/screen(smallest),/ebook(medium), or/printer(larger but higher quality).- Ghostscript:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.