OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Reading ascii data with iText fails

  • Thread starter Thread starter Andrus
  • Start date Start date
A

Andrus

Guest
Trying to read ascii data from simple pdf file in C# .NET 8 using iText7

Code:
StringBuilder processed = new StringBuilder();

    for (int i = 1; i <= pdfDocument.GetNumberOfPages(); ++i)
    {
         var page = pdfDocument.GetPage(i);
         string text = PdfTextExtractor.GetTextFromPage(page, strategy);
         processed.Append(text);
    }

returns garbled text

����������\n�������������������������\n

Text can copied from PDF in Adobe Acrobat PDF viewer.

PDF is in

https://wetransfer.com/downloads/e21c2093f9a732287383fc5ca97104cd20240414124039/b3ad1e

How to read text from this PDF ? Can iText configured or some other PDF reading librady used ?

This is already asked in

Reading text from pdf with iText7 + C#, text not recognized

but not solved.
<p>Trying to read ascii data from simple pdf file in C# .NET 8 using iText7</p>
<pre><code>StringBuilder processed = new StringBuilder();

for (int i = 1; i <= pdfDocument.GetNumberOfPages(); ++i)
{
var page = pdfDocument.GetPage(i);
string text = PdfTextExtractor.GetTextFromPage(page, strategy);
processed.Append(text);
}
</code></pre>
<p>returns garbled text</p>
<p>����������\n�������������������������\n</p>
<p>Text can copied from PDF in Adobe Acrobat PDF viewer.</p>
<p>PDF is in</p>
<p><a href="https://wetransfer.com/downloads/e21c2093f9a732287383fc5ca97104cd20240414124039/b3ad1e" rel="nofollow noreferrer">https://wetransfer.com/downloads/e21c2093f9a732287383fc5ca97104cd20240414124039/b3ad1e</a></p>
<p>How to read text from this PDF ?
Can iText configured or some other PDF reading librady used ?</p>
<p>This is already asked in</p>
<p><a href="https://stackoverflow.com/questions/60771120/reading-text-from-pdf-with-itext7-c-text-not-recognized">Reading text from pdf with iText7 + C#, text not recognized</a></p>
<p>but not solved.</p>
Continue reading...
 

Latest posts

I
Replies
0
Views
1
impact christian
I
Top