You can do this in Ghostscript. I have been looking for a solution for the similar problem and after trying so many different scripts the most reliable one is ghost script.
$command = "gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.6 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=pdf_out.pfg pdf_in.pdf";
$p_result = exec($command);
these are the options for your out pdf;
-dPDFSETTINGS=/screen (screen-view-only quality, 72 dpi images)
-dPDFSETTINGS=/ebook (low quality, 150 dpi images)
-dPDFSETTINGS=/printer (high quality, 300 dpi images)
-dPDFSETTINGS=/prepress (high quality, color preserving, 300 dpi imgs)
-dPDFSETTINGS=/default (almost identical to /screen)
The problem is this : You have got a steak and you want it to convert another type of steak, so the other scripts are taking your steak, turning in to minced meat and than making steak again. So the outcome will never be exactly same.
For example if your pdf has got a text says "click here" and takes you to www.example.com , after converting the version of pdf, the "click here" link is being removed.