title: Convert PDF to HTML without losing any format
body: <p>I'm developing a Python Flask webapp and I'm trying to convert some user uploaded pdfs to nicely formatted HTML, like the HTML that is being produced when you display a pdf inside an <code>iframe</code>.</p>
  
  <p>I tried several things so far:</p>
  
  <ul>
  <li>the <code>pdfminer.six</code> library, produced messy HTML, </li>
  <li>trying to grab the produced HTML, when rendering a PDF with pdf.js, which is apparently hidden in a <a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM" rel="nofollow noreferrer">Shadow DOM</a> with no access to its inner HTML</li>
  <li>finally I came across <code>pdf2htmlEX</code> (<a href="https://github.com/pdf2htmlEX/pdf2htmlEX" rel="nofollow noreferrer">https://github.com/pdf2htmlEX/pdf2htmlEX</a>) which produced exactly what I wanted. </li>
  </ul>
  
  <p>Locally, this solution worked great, however in the production state (Heroku) I was unable to install it correctly. The project is deprecated and the documentation is limited and terrible. The problem has something to do with broken dependencies.</p>
  
  <p>So, how to convert PDFs to HTML effectively without losing any format using Python or any other tool?</p>
  
  <p>Thanks a lots. </p>
  
  <p><em>if anyone is willing to help me getting the <code>pdf2htmlEX</code> to work on heroku, leave a comment and I will post more details in a different post</em></p>