I am trying to find a way to put all the sub tags into the tags root directly, for example:
i have this tag tree
I need a way to extract (<p> , <h1>,<h2> ) from these parts, secs and sub parts or sections and put them into the root itself so it can be like this
Olaf Drümmer alludes to use of PDF Libraries to perform programmatic tagging such as you describe at the end of this video:
Keep in mind that not all PDF Libraries are created equal. You'd need a front-runner (such as that available from Adobe).