Kaitai is very useful for reverse engineering a binary file that you have some assumptions of. I've used it for save file reverse engineering and then creating a read/write library for it. It should be usable for PDF Metadata.
Be careful, "any" is a strong word in this context. Interestingly enough, I actually use PDF as the "hello world" for kicking the tires on any such file format descriptor I find because PDF is such a crazypants specification. Thus, if the descriptor language is able to accurately capture the layout of a PDF, it's obviously well thought out.
I haven't had a lot of luck thus far, except ones which allow escaping out of declarative mode over into "and then run this code"
It looks perfectly nice for its role, but I didn’t use it for my last project because I need serialization as well.