how to reduce size of pdf

= good ways =

== Never forget ==

To check which options the graphic program/oo.org etc. has. Typically
with the correct generation of the pdf you can safe much more then
afterwards!

Many variants are useless and the process might be time consuming. So
better you make sure that the images you include in the document have
appropriate size before you start any other optimizations.


== gs ==

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4  -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

just rewrites the pdf, which is sometimes enough.
To actually reduce the size of the images within the image, use
PDFSETTINGS screen (72dpi)

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

Other options:
/screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
/ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
/printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
/prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
/default selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file.

-dColorImageDownsampleType=/Bicubic
-dColorImageResolution=120

[http://ghostscript.com/doc/current/Ps2pdf.htm]




= maybe useless =

== pdftk ==

pdftk idea.pdf output idea-tk.pdf

-> same size

== pdf2ps2pdf ==

In my tests pdf2ps and ps2pdf  made the image larger or same size.



= ugly ways =

== convert ==

Even more aggressive is resizing it, e.g.

convert -resize 500x500 input.pdf output.pdf

(note that this also destroys vectors and makes a bitmap)
Afterwards you can reduce even more with trick above

== pdfsizeopt ==

(together with Multivalent20060102.jar, warning, 2009 does not work)
best used within git clone https://github.com/pts/pdfsizeopt
Warning: May destroy parts of pdf (unreadable fonts or similar)


= literature =

http://www.freiesmagazin.de/20110102-januarausgabe-erschienen
http://stackoverflow.com/questions/819180/how-to-optimize-pdf-file-size
Fr Jul 30 13:54:24 CEST 2021
patent_button.gif valid-html401.png elektra.jpg fsfe-logo.png valid-css.png vim.gif anybrowser.gif