title: Reading pdf  content using iTextSharp in C#
body: <p>I use this code to read pdf content using iTextSharp. it works fine when content is english but it doesn't work whene content is Persian or Arabic<br> Result is something like this :
  <br> <a href="http://dl.dropbox.com/u/54490657/Stackoverflow/FoundationsOfProgramming-Persian.pdf" rel="noreferrer">Here</a> is sample non-English PDF for test.    </p>
  
  <blockquote>
    <p>ÙŽÙ›Ù†Ø§ ÙÙ”Ø¨Ù˜Ø·Ø« ÛŒØ¿ÛŒÙ›Ù˜  Ø²Ø¾Ø§ ÙÙ›ÙØ­Ù” Ù‚Ù›Ù…Ø­
    ÛŒÙ”Ø¨Ù•Ø³ Â© Karl Seguin   foppersian.codeplex.com 
    www.codebetter.com  1 1  ÙÙ”Ø¨Ù˜Ø·Ø« ÙŽÙ›Ù†Ø§ ÛŒØ¿ÛŒÙ›Ù˜ </p>
  
  <pre><code>Ù‡Ù…Ø§Ù†Ø±Ø¨ Ù„ÙˆØµØ§ ÛŒØ³ÛŒÙˆÙ†  Ù…Ø±Ù† Ø¯ÛŒÙ„ÙˆØª Ø±ØªÙ‡Ø¨ Ø±Ø§Ø²ÙØ§
  </code></pre>
  </blockquote>
  
  <p>What is the solution ?</p>
  
  <pre><code>  public string ReadPdfFile(string fileName)
          {
              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(Encoding.Convert(Encoding.Default, Encoding.UTF8, Encoding.UTF8.GetBytes(currentText)));
                      text.Append(currentText);
                      pdfReader.Close();
                  }
              }
              return text.ToString();
          }
  </code></pre>