title: How to preserve document structure in tesseract
body: <p>I am using tesseract ocr to extract text from an image. Preserving the structure of the document is very important to me. Currently tesseract does not preserve the structure, infact it changes the order of text. My input is the image below.</p>
  
  <p><img src="https://i.stack.imgur.com/iY2Tb.png" alt="input"></p>
  
  <p>and the output I am getting is as follows:</p>
  
  <pre><code>Someto the left
  Someto the left
  
  Some in the middle
  Some in the middle
  
  Some with some tab
  Some with some tab
  
  Some with some space between them
  Some with some space between them
  
  Sometext here
  Sometext here
  
  this much
  this much
  </code></pre>
  
  <p><strong>How do I get the desired output as of the same structure in image?</strong></p>
  
  <p>i.e. as follows:</p>
  
  <pre><code>                                                 Some text here
                                                   Some text here
  
  Some to the left
  Some to the left
  
                      Some in the middle
                      Some in the middle
  
          Some with some tab
          Some with some tab
  
  Some with some space between them                       this much
  Some with some space between them                       this much
  </code></pre>