Linux: Compress PDF – Reduce PDF Size

A scanned document saved as PDF can be too large, that is not always good.

For example, the large size of a PDF file won’t permit to send it by email because of the probable limitation on the maximum size of attachments.

In Linux you can compress a PDF file from the command line without losing its quality, with the help of ps2pdf tool, that is a part of ghostscript suite.

From this article you will learn how to compress a PDF file and significantly reduce its size from the Linux command line.

Cool Tip: Plan to send this PDF somewhere or just keep? How about to protect it with a password? This is really easy for ones who reduce the size of a PDF file from the command line! Read more →

First of all it is required to install the ghostscript suite that provides the ps2pdf utility:

$ sudo apt-get install ghostscript

Compress PDF File In Linux

Run the following command to compress and reduce the size of the LARGE.pdf file and save the result to the SMALL.pdf file:

$ ps2pdf LARGE.pdf SMALL.pdf

Effectiveness is obvious:

$ du -sh *.pdf
7,6M	LARGE.pdf
500K	SMALL.pdf

11 Replies to “Linux: Compress PDF – Reduce PDF Size”

  1. Thank you very much for your hack! It worked like a charm and I did learn something new.

  2. Exactly what I needed too. Thank you.

  3. Great “hack”. Compressed my PDF from 12,6 MB to 12,5 MB….

  4. wonderful: from 900.5 to 901.9. This is exactly what I was looking for! You made my day!

  5. from
    2.3M Fall_18-19-ACCT_422-PPT-11-1544528806-2018-12-11.pdf
    to
    2.6M Fall_18-19-ACCT_422-PPT-11-1544528806-2018-12-111.pdf
    hhhhhhhhhhhh

  6. Thank you for this! On average, my pdf files are being reduced to half their original size.

  7. Nonsense. This created a larger file.

  8. The real great hack! Have 1.5GB pdf after processing some pages, this stuff gives me a 6MB file. WOW! Want know, why.

  9. nothing happens, same file size

  10. For those who complain it doesn’t work make try another file. Perhaps the file you’re trying to compress is the smallest size possible and cannot be further compressed

  11. Converted a test file from 876k to 128k. I have hundreds of files and I can save a lot of space by running this on them. Thanks!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.