code: def compress(pdf_in, pdf_output):
      
      cmd = 'gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sOutputFile=%s %s'
      cmd = cmd % (pdf_output, pdf_in)
      os.system(cmd)
docs: mac下安装 brew install ghostscript
      :param pdf_in:
      :param pdf_output:
      :return: