PDF optimization

Is it possible to have PHP analyze a uploaded PDF and compress it?

Are you talking generally or ones compiled in PHP?

No generally. Like if I upload a random PDF and have a script compress it to resolution 72 ppi for example.

There is no print function built into PHP’s core PDF functions, so you may be able to find an external library. Reducing the ppi to me, sounds like you would need to open the pdf, print it to a temp location then move it back. If you are uploading a few pdf’s and won’t need them right off, i’d do the compression at like 2 am via a cron job.