title: how can we extract text from pdf using itextsharp with spaces?
body: <p>I am using below method to extract pdf text line by line. But problem that, it is not reading spaces between words and figures. what could be the solution for this ??</p>
  
  <p>I just want to create a list of string, each string in list object has a text line from pdf as it is in pdf including spaces.</p>
  
  <pre><code>public void readtextlinebyline(string filename)   {
  
  
          List&lt;string&gt; strlist = new List&lt;string&gt;();
          PdfReader reader = new PdfReader(filename);
          string text = string.Empty;
          for (int page = 1; page &lt;= 1; page++)
          {
  
              text += PdfTextExtractor.GetTextFromPage(reader, page ,new LocationTextExtractionStrategy())+" ";
  
          }
          reader.Close();
          string[] words = text.Split('\n');
          foreach (string word in words)
          {
              strlist.Add(word);
          }
  
          foreach (string st in strlist)
          {
              Response.Write(st +"&lt;br/&gt;");
          }
  
     }
  </code></pre>
  
  <p>I have tried this method by changing strategy to SimpleTextExtractionStrategy as well but it is also not working for me.</p>