TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How to make the PDFs produced by pdflatex smaller?

I wrote my thesis in LaTeX and so far I always compiled with pdflatex. The thesis is 150 pages with many pictures and graphs. The resulting PDF file is 40 MB.

Now, I'm facing the problem that for administrative purposes they need it in a file which shouldn't exceed 30 MB in size (don't ask me why).

How can I reduce the size of the output PDF? I don't mind loosing a bit of quality in the images but I don't seem to find any way of doing that.

share|improve this question

marked as duplicate by Joseph Wright Apr 15 '12 at 9:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

@Fabio - are any of the individual figure files large, or do you have a very large number of small files? If you do have large figure files, what type are they (i.e. eps/pdf/jpg etc.)? – Ian Thompson Mar 28 '11 at 16:01
@Ian, I do have many images, some are small some are bigger. I do have .eps, .png and .jpg .. thank you – Fabio Varesano Mar 28 '11 at 16:10
If you find it hard to install pdfsizeopt, then I'm willing to try running it on your thesis for you, to see if it will be likely to compress sufficiently. – Lev Bishop Mar 28 '11 at 18:07
Another related question: How to make the PDFs produced by pdflatex smaller? – Daniel Jan 16 '12 at 20:37

The elephant in the room are the embedded bitmaps, which can blow up the file size really fast. I have a 400 page book manuscript with lots of molecular structures rendered at 600 dpi (for print), and the overall file size is 50 Mb.

I just googled around for a way to reduce the resolution of embedded images and found that ghostscript can do this:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=small.pdf big.pdf

The level of compression is adjusted by the -dPDFSETTINGS switch:

-dPDFSETTINGS=/screen   (screen-view-only quality, 72 dpi images)
-dPDFSETTINGS=/ebook    (low quality, 150 dpi images)
-dPDFSETTINGS=/printer  (high quality, 300 dpi images)
-dPDFSETTINGS=/prepress (high quality, color preserving, 300 dpi imgs)
-dPDFSETTINGS=/default  (almost identical to /screen)

With my file, the down-sampled images produced with the /screen and /ebook settings look very coarse, but the output of the /printer setting looks very nice on screen, while still bringing the file size down from 50 to 13 Mb. Hyperlinks were preserved. So, this seems to be straightforward and viable option.

share|improve this answer
This is an amazing find. Took my 29MB pdf down to 639K with the ebook setting. – Rovanion Nov 19 '14 at 7:49
@Michael Palmer: I tried and I get an error No such file or directory. I tried with the correct directory for both the input and output files, but still same error – ThePredator Nov 19 '15 at 14:46

As described in my answer to the other question about shrinking pdf files you can use pdfsizeopt to do lossless compression of your pdf. If it turns out to be necessary to do lossy compression, then adobe acrobat professional has a "PDF optimzer" tool that can do this.

share|improve this answer
Tried running it NotImplementedError: PDF-1.5 cross reference streams not implemented – Fabio Varesano Mar 30 '11 at 11:18
\usepackage{pdf14}, so that tex generates PDF-1.4. – Lev Bishop Mar 30 '11 at 12:11
thanks, this way it's been able to do something but then: AssertionError: sam2p_np failed (status) – Fabio Varesano Mar 30 '11 at 12:31
Are you using the latest sam2p from pdfsizeopt.googlecode.com/files/sam2p ? This error message is mentioned in the bug tracker, but only in relation to (unsupported) installation on windows. – Lev Bishop Mar 30 '11 at 12:47

There is a package called degrade that compresses .jpg files (I've never used it, though). It may be just as easy to compress the files yourself, using suitable graphics software. It's usually just a question of opening the file, selecting save as choosing the jpeg format and adjusting the quality.

I don't know much about .png files. You could convert them into .jpg files.

It's usually best to avoid converting .eps files into .jpg files, especially if they contain text or formulae. As it happens, I've been working on a program that can reduce the size of .eps files in some circumstances. It's not quite finished yet, but if you have any .eps files that are large, I would be interested in seeing them. My email address is on my homepage (click on my name and follow the link). Alternatively you could put them somewhere on the web where I can download them.

share|improve this answer
You don't have to convert png files; pdfTeX can handle them. If you want, you can try to compress them with pngcrush. And I recommend to simply convert your eps to pdf with ghostscript (e.g. ps2pdf). – Martin Schröder Jan 17 '12 at 0:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.