'How to use ghostscript to check if pdf is already converted to pdf/a?

I searched for an answer but all I could find is how to convert pdf to pdf/a which is what I'm already doing. Now I need to find if the pdf is converted to prevent unnecessary second conversion. Right now I'm using Aspose to check if the pdf is converted but it's not always working correctly. Or maybe there's a different approach with either pdfbox or itext?

Thanks in advance for all the help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source