title: Read text from PDF on .NET Core using Any open source / non-licensed packages
body: <p>I need to read <em>PDF</em> and convert it in a <em>.Txt</em>. I tried <code>iTextSharp</code> as free library, it was working fine but not compatible with .NET Core.</p>
  
  <p><em>Code snippet in iTextSharp</em></p>
  
  <pre><code>string prevPage = "";
  for (int page = 5; page &lt;= reader.NumberOfPages; page++)
  {
    ITextExtractionStrategy its = new SimpleTextExtractionStrategy();
    var s = PdfTextExtractor.GetTextFromPage(reader, page, its);
    if (prevPage != s) sb.Append(s);
    prevPage = s;
  }
  reader.Close();
  </code></pre>
  
  <p>Also, I tried <code>iTextSharp.LGPLv2.Core</code> but it does not work as well as the other one, and the results are not accurate.</p>
  
  <p>One of the downsides <code>iTextSharp.LGPLv2.Core</code> is that it does not support encoding and results in <em>noise</em> in the extracted text of the PDF</p>
  
  <p>My stringbuilder looks like the image below:</p>
  
  <p><a href="https://i.stack.imgur.com/yAwmo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/yAwmo.png" alt="enter image description here"></a></p>