Use gs with -dPDFSETTINGS=/ebook option.
gs
-dPDFSETTINGS=/ebook
$ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=out.pdf in.pdf