Compress PDF to 2MB or less

1

I have PDF files, tonnes (~1000) of them for a government report, varying from 600kb to 500MB.

Problem is that the portal only allows upload of files up to 2MB.

I have Windows (which I find fairly useless), Linux (where I managed to compress a 150MB file to 10MB using techniques described below), and Mac at my disposal.

In Linux, I used GhostScript and ImageMagick

  1. ps2pdf
 ps2pdf LARGE.pdf SMALL.pdf

Also, pdftops and converting back, as suggested by some sites.

  1. ImageMagick
convert -density 200 -compress jpeg -quality 20 test.pdf test2.pdf

with lower density (as low as 100x100,

  1. GhostScript
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=out.pdf in.pdf

Doing it intermixed helped me with few files, for example, compressing a 150MB file down to 10MB with a huge loss of clarity.

That's when I saw this file (link) which has nearly 150pages, compressed to 1.53MB, without much loss of quality. How do I achieve this? Any OS, but preferably Windows/Linux!

Jesse P Francis

Posted 2019-04-09T13:48:54.430

Reputation: 141

Would help to know what the content of your files is… just text? Some images? Mostly images? Is the text readable? Do you care about image quality? – slhck – 2019-04-09T15:21:19.990

It's mostly images. But some files may have text as well, converted from word – Jesse P Francis – 2019-04-09T15:44:07.783

Answers

0

From the example you provided, I can see it was compressed with 3-heights PDF optimization shell;

enter image description here

It works similar to method 1 that you posted where you specify command line arguments against the source PDF with additional comrpession options. I am unable to tell which options were set for this compression, however there is a guide on the site detailing which options you can use to compress the contained images/text etc. Using the same program as your example should help you get a closer compression to what you want to achieve as they have done.

https://www.pdf-tools.com/pdf20/en/products/pdf-optimization/pdf-optimizer/#c8353

Note: It is only feasible to compress to the point that the document is still legible, which can be a problem in itself for what you want to achieve; if you have a High-res picture of text which is slightly blurry (regardless of it being blurry, its still going to be for example 4MB), we can then compress that to 2mb and if at which point it is then nearly unreadable, you will be "unable" to compress further (if you want it still to be legible) but it will still take up 2mb (which is relatively large for a blurry picture!) - but you get what I mean, if theyre reluctant to increase the 2MB limit then you're going to have to sacrifice clarity as you said.

RhysPickett

Posted 2019-04-09T13:48:54.430

Reputation: 102

Thank you, trying to get it working! – Jesse P Francis – 2019-04-09T15:44:22.533