gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=clean.pdf original.pdf # In windows, replace 'gs' with 'gswin32c.exe'