title: Apache POI for docx Insert Text On Specific Page
body: <p>I'm trying to make Table of Contents for my Word document docx.</p>
  
  <p>Apache POI is still too buggy. The <code>document.createTOC()</code> does not produce anything unless placed at the end. Sometimes, it doesn't give the correct page numbers.</p>
  
  <p>The <code>document.enforceUpdateFields()</code> doesn't do anything!</p>
  
  <p>So I thought I make my own method that creates the Table of Content. However, I will call it at the end but I need it to be inserted at the beginning!</p>
  
  <p>In other words, suppose my document at some point in my program has some text on the first page and the second page. And I haven't yet saved it; how do I insert at the beginning of first page?</p>