title: extract PDF text by columns
body: <p>My question is:</p>
  
  <p>How can I extract text from a PDF file which is divided in columns in a way that I get the result separated by this columns?</p>
  
  <p>Background:
  I work on a project about text analyses (especially scientific texts). 
  These texts sometimes are published in muliple column layouts with each column given a separate page number.
  To order the extracted text by the layouted pagenumbers it would be useful to extract the text by columns.</p>
  
  <hr>
  
  <p>I use <strong>pdfBox</strong> and tried / searched for several things:</p>
  
  <ul>
  <li>I tried the <code>getThreadBeads()</code> method of the <code>PDPage</code> class -> result: list with 0 size</li>
  <li>I tried graping the text with the <code>getCharactersByArticle()</code> method -> text not divided in columns<br>
  (I tried this with pdf files of published texts as well as with self created .doc based files, each have a multiple column layout)</li>
  </ul>
  
  <p>The thing is that pdfBox seems to divide the text by columns automatically:
  If I set <code>setSortByPosition()</code> of a <code>PDFTextStripper</code> on true all signs of a page are set in a line without recognizing separate columns.
  But if I set <code>setSortByPosition()</code> on false the stripper is doing this division.</p>
  
  <p>For that I had a look to the pdfBox source code:
  The crucial method is the <code>writePage()</code> method of PDFTextStripper.
  Here spaces (which are not given in most pdfs) and line breaks are calculated obviously.
  But I couldn't find how the Stripper is calculating the column breaks.</p>
  
  <p>So the questions again:</p>
  
  <ul>
  <li>How is PDFTextStripper calculating column breaks?</li>
  <li>Are there methods in the pdfBox API to catch this / to extract the text by columns?</li>
  <li>Is this possible with other pdf-api?</li>
  </ul>
  
  <p>thanks in advance</p>