PDF is a format for preserving layouts across different platforms when viewing and printing. It is not intended for data processing and so on. I don't see why a structured document format can't exist that simplifies processing and increases accessibility while still preserving the layouts.
What about open office docs? (ODF – OpenDocument Format, like .odt, .ods, .odp)
JavaScript in particular is actively hostile to stability and determinism.
I have not looked at those formats but take docx for example. That structure is complicated because the layout needs to be described and editable.