Hi,
Is there a reason to use Java, python or PHP? What i am aware of is using a ghostscript which ca convert a pdf to PDF/A or to some other formats. It uses a command line in Linux to convert the PDF files.
I am not sure if ghostscript meet your real requirement, but if interested, we can do a test on your Linux server.
If interested please contact me.
Thank You