ghostscript

How to shrink a .pdf file produced with pdflatex?

When I produced a .pdf file with pdflatex its size was 28MB! Ups! How can I get a smaller file?

There is an excellent advice found here how to do it:

A common approach is to let Ghostscript (gs) optimize and
compress the PDF after it has been created with pdflatex.
Ghostscript is installed by most Linux distributions and
 easily available for other platforms (Windows as binaries,
 MacOS via MacPorts). In fact, almost all size-optimizing
 tools for PDF (save for Acrobat) you can find on the
 internet, internally use Ghostscript -- so you can as
 well call it directly. There is a pletoria of options
 available; I personally use the following:

 gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4
 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=foo-compressed.pdf
 foo.pdf

I use this mostly for beamer presentations, where it gets
 me a size reduction of 60-70 percent. (A ten MiB lecture
 note becomes three too four MiB in size.)

Here is how I call it:

"C:\Program Files\gs\gs9.04\bin\gswin64.exe"
 -sDEVICE=pdfwrite
 -dCompatibilityLevel=1.4
 -dNOPAUSE
 -dQUIET
 -dBATCH
 -sOutputFile=smaller_pdf_file.pdf
 my_pdf_file.pdf
 
public/ghostscript.txt · Last modified: 2013/01/28 10:27 (external edit) · []
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki