title: How to heal inconsistent parent tree mappings in a PDF created by pdfBox
body: <p>We are creating pdf documents in Java using pdfBox. Since they should be accessible by Screenreaders, we are using tags and we are setting up a parentTree and we add that to the document catalog.</p>
  
  <p>Please find an <a href="https://www.dropbox.com/s/fq6m3o4rx9swq76/Testdatei.pdf?dl=0" rel="nofollow noreferrer">example file here</a>.</p>
  
  <p>When we check the resulting pdf with PAC3 validator we get 25 errors for inconsistent entries in the structural parent tree.</p>
  
  <p><img src="https://i.stack.imgur.com/rDIxF.png" alt="enter image description here"></p>
  
  <p>Same result but more details in Adobe prefight syntax error check. The error message is </p>
  
  <pre><code>Inconsistent ParentTree mapping (ParentTree element 0) for structure element 
  Traversal Path:-&gt;StructTreeRoot-&gt;K-&gt;K-&gt;[1]-&gt;K-&gt;[3]-&gt;K-&gt;[4]
  </code></pre>
  
  <p>Adobe preflight syntax error check
  <img src="https://i.stack.imgur.com/v9hU4.png" alt="Adobe preflight syntax error check"></p>
  
  <p>When i try to follow that traversal path in pdfBox Debugger, i see an <a href="https://i.stack.imgur.com/0SmVc.png" rel="nofollow noreferrer">element referencing the ID 22</a>. </p>
  
  <p>Now my questions are: </p>
  
  <ol>
  <li>What is the connection between the StructTreeRoot and the ParentTree? </li>
  <li>Where in the StructTreeRoot/ParentTree can i find the item with ID 22 that is refered to in node K->K-><a href="https://i.stack.imgur.com/rDIxF.png" rel="nofollow noreferrer">2</a>->K-><a href="https://i.stack.imgur.com/0SmVc.png" rel="nofollow noreferrer">4</a>->K-><a href="https://i.stack.imgur.com/0SmVc.png" rel="nofollow noreferrer">4</a>? See image <a href="https://i.stack.imgur.com/0SmVc.png" rel="nofollow noreferrer">PDF Debugger</a></li>
  <li>What is that Parent Tree element 0 in the Preflight error message? See image <a href="https://i.stack.imgur.com/v9hU4.png" rel="nofollow noreferrer">Adobe preflight syntax error check</a></li>
  </ol>
  
  <p>PDF Debugger
  <img src="https://i.stack.imgur.com/0SmVc.png" alt="PDF Debugger"></p>
  
  <p>I think, building accessible pdf with pdfBox as well as error messages from common validation tools are rather poorly documented. Or where can i find more information about it?</p>
  
  <p>Thanks a lot for your help.</p>