Need a Java-based solution or, at the worst, command-line for Linux.
I tried to use Ghostscript:
gs -sDEVICE=pdfwrite -dPDFA -dBATCH -dNOPAUSE -dUseC
Try moonshiner, a GUI to ghostscript.