Frosch trägt Aktenstapel

Compress PDFs

Language icon Language: this article is available in: de

Sometimes an important form has crazy low upload limits. Then you need to shrink your PDF file.

Luckily there is a tool called Ghostscript (Linux package: commonly called ghostscript, Windows download). Open your terminal or command prompt navigate to your directory and type the following command:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=OUTPUT.pdf INPUT.pdf

Then you need to set three or four parameters:

  • Windows users may need to replace gs by gswin32, gswin64 or even the whole path "C:\Program Files\gs9.23\bin\gswin64.exe"
  • PDFSETTINGS has multiple levels/profiles (from low to high quality)
    This preference sets the desired quality or (the other way around) compression rate!
    • /screen (tiny)
    • /ebook (readable)
    • /prepress (printable)
    • /printer
    • /default
  • OUTPUT.pdf is the path to your output file and
  • INPUT.pdf to your input file

Run the command - done! The results are great. I could compress my PDFs vom 4 MB to 200 KB which matched the limit so the upload was successful.

There also are scripts as a shortcut for this long command.


Keine Kommentare

Kommentar verfassen