title: iTextSharp How to read Table in PDF file
body: <p>I am working on convert PDF to text. I can get text from PDF correctly but it is being complicated in table structure. I know PDF doesn't support table structure but I think there is a way get cells correctly. Well, for example:</p>
  
  <p><a href="https://i.stack.imgur.com/2oBfQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2oBfQ.png" alt=""></a></p>
  
  <p>I want to convert to text like this:</p>
  
  <pre><code>&gt; This is first example.
  
  &gt; This is second example.
  </code></pre>
  
  <p>But, when I convert PDF to text, theese datas looking like this:</p>
  
  <pre><code>&gt; This is This is
  
  &gt; first example. second example.
  </code></pre>
  
  <p>How can I get values correctly? </p>
  
  <p>--EDIT: </p>
  
  <p>Here is how did I convert PDF to Text:</p>
  
  <pre><code>OpenFileDialog ofd = new OpenFileDialog();
          string filepath;
          ofd.Filter = "PDF Files(*.PDF)|*.PDF|All Files(*.*)|*.*";
  
          if (ofd.ShowDialog() == DialogResult.OK)
          {
              filepath = ofd.FileName.ToString();
  
              string strText = string.Empty;
              try
              {
                  PdfReader reader = new PdfReader(filepath);
  
                  for (int page = 1; page &lt; reader.NumberOfPages; page++)
                  {
                      ITextExtractionStrategy its = new iTextSharp.text.pdf.parser.LocationTextExtractionStrategy();
                      string s = PdfTextExtractor.GetTextFromPage(reader, page, its);
  
                      s = Encoding.UTF8.GetString(ASCIIEncoding.Convert(Encoding.Default, Encoding.UTF8, Encoding.Default.GetBytes(s)));
                      strText += s;
                  }
                  reader.Close();
               }
               catch (Exception ex)
              {
                  MessageBox.Show(ex.Message);
              }
          }
  </code></pre>