Install Ghost Script and use the following command line
C:\Program Files\gs\gs9.27\bin>gswin64.exe -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="D:\\compressed.pdf" "D:\\original.pdf"