pdfcompress batch-compresses PDF files and keeps the originals.
- takes one or more PDF filenames as arguments
- shows the file list and a count, then waits for confirmation before doing anything
- compresses each PDF via
qpdf --linearizepiped intopdftk ... compress - moves the original (pre-compression) copies into an
orig/subfolder
- macOS
- Linux
qpdfpdftk
Install qpdf and pdftk via your package manager first, then run against one or more files:
pdfcompress file1.pdf file2.pdfCompress every PDF in the current directory:
pdfcompress *.pdfCompress a single file:
pdfcompress report.pdf- Requires at least one filename argument — running it with none prints a short message and exits.
- Prompts once with a file list and count, then waits for Enter (or Ctrl+C to cancel) before compressing.
- Originals end up in
./orig/(created if it doesn't exist yet); the compressed file replaces the original filename in place.
- Compression happens via a temporary
.uncompressedcopy of each file in the current directory before the move intoorig/— don't rely on filenames matching*.pdf.uncompressedfor anything else while this is running. - No dry-run mode; review the file list shown at the confirmation prompt before pressing Enter.