How to make the PDFs produced by `pdflatex` smaller

One of the major issues faced with documents using Latex is the size of the document. The best method to reduce the size of the document or pdf is to use ghost script.
Ghostscript (gs) is installed by most Linux distributions and easily available for other platforms (Windows/ GNU/Linux / Mac).

Issue the below command to generate a smaller size pdf.

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

Lots of options are available and you can change that according to your need.Change the input.pdf with your file name.