title: Manipulate tag tree from tagged pdf
body: <p><strong>Question:</strong>
  I was working on tags for accessibility with iText7 and I want to manipulate the structure of the tag tree.</p>
  <p><strong>The task would be like.</strong>
  First of all, extract the tag tree from tree. Then, move the  node to it's parent node.</p>
  <p>The demonstrate structure to be like this.</p>
  <pre><code>[Before]
  &lt;H1&gt;
      &lt;H2&gt;
          &lt;Span&gt;
                &quot;Description&quot;
  &lt;H3&gt;
      &lt;Span&gt;
            &quot;Item&quot;
  </code></pre>
  <pre><code>[After]
  &lt;H1&gt;
      &lt;Span&gt;
            &quot;Description&quot;
  &lt;H2&gt;
      &lt;Span&gt;
            &quot;Description&quot;
  &lt;H3&gt;
      &lt;Span&gt;
            &quot;Item&quot;
  </code></pre>
  <p>Is it possible to use some libraries to approach my goal?
  As my understanding, the <a href="https://github.com/itext/itext7/tree/62a6564b82da401353c017da47b3b01eff054f84/kernel/src/main/java/com/itextpdf/kernel/pdf/tagutils" rel="nofollow noreferrer">tagUtils</a> in iText might be helpful.
  I already trying parse tagged pdf with iText under pdf specification. Yet, it's extremely Unintuitive. Since the well-known pdf tools, Acrobat can show the tags on the panel to make the pdf be accessibility. It must be some libraries to extract the tag tree from tagged-pdf without pain.</p>
  <p><a href="https://i.stack.imgur.com/VuwrR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VuwrR.png" alt="enter image description here" /></a>
  <a href="https://imgur.com/4BfHUBT" rel="nofollow noreferrer">Imgur</a></p>
  <p><strong>Any response would be extremely helpful. Thanks.</strong></p>