title: Itext7 Reading a PDF in c# (with Hebrew)
body: <p>Need some help
  I have a pdf, and I just need to read it and store it content in DB.
  From some reason, I couldn't find a simple example of doing that using Itext 7</p>
  
  <p>another thing, the content is in Hebrew, at first I used iTextSharp, but the content I got is in reverse order, so I have two options:
  1. fix the reverse code
  2. maybe find a more normal code maybe in Itext7 which don't have this problem.</p>
  
  <pre><code>StringBuilder text = new StringBuilder();
  
  if (File.Exists(fileName))
  {
      PdfReader pdfReader = new PdfReader(fileName);
  
      for (int page = 1; page &lt;= pdfReader.NumberOfPages; page++) 
      {
          ITextExtractionStrategy strategy = new SimpleTextExtractionStrategy();
          string currentText = PdfTextExtractor.GetTextFromPage(pdfReader, page, strategy);
  
          currentText = Encoding.UTF8.GetString(ASCIIEncoding.Convert(Encoding.Default, Encoding.UTF8, Encoding.Default.GetBytes(currentText)));
  
          var res = ConvertToHebrew(currentText);
          text.Append(res);
      }
      pdfReader.Close();
  }
  </code></pre>
  
  <p>The convertToHebrew function is not perfect for me, so I hope to find something which work without me trying to fix things.</p>