A shell script to create low quality variants of PDF files with GhostScript

How it works:

  • Use find to get a list of all PDF files in the given directory.
  • For each file:
    • Is the file larger than the minimum required file size (5MB)?; skip, if no, continue if yes.
    • Create a low quality variant of the file in /tmp, named „originfilename_low.pdf“
    • Check if low quality variant has a lower file size; if yes move it to the origin folder. If the new file is larger then the origin, remove it.

The script can be found on GitHub, see here.

Ähnliche Themen...

2 Gedanken zu „A shell script to create low quality variants of PDF files with GhostScript“

  1. Schönes Script. Die optimierten pdf-Dateien sind z.T. deutlich kleiner und die Qualität ist subjektiv empfunden immer noch beachtlich. Danke!

  2. Thanks! I’ll definitely try it. It bothers me to have files like invoices, sometimes larger than 3mb with nothing in it than text and some colored areas.

Kommentare sind geschlossen.