title: Tika with Python to parse PDF text is not able to handle vertical text. Any ideas?
body: <p>I am trying to extract text from a PDF using Python Tika library. The library is picking up text in the sequence I want. However, it is not able to handle vertically aligned text.</p>
  <p>For example, the word,</p>
  <p><a href="https://i.stack.imgur.com/6V6LG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6V6LG.png" alt="Values" /></a></p>
  <p>is read as:</p>
  <pre><code>V
  al
  
  ue
  s  
  </code></pre>
  <p>There are many other such instances where vertical text is not parsed correctly. I tried using other libraries like pypdf2, pdfminer3, pdfplumber, etc.. but for most of them the sequence of the text is not correctly ordered. Tika was able to give the best result.</p>
  <p>Any ideas about how this be fixed? I used the simplest code as follows:</p>
  <pre><code>from tika import parser
  file_data = parser.from_file(&quot;sample.pdf&quot;)
  text = file_data['content']
  print(text)
  </code></pre>
  <p>Are there any other optional parameters I should be aware of?</p>