title: Read a PDF Line by Line - iTextSharp
body: <p>I'm not sure what is wrong with my code. It reads the PDF file, and grabs all the text, but every item is combined together into one string with no separator of any kind.</p>
  
  <p>Sample:</p>
  
  <p>"Houses: 2</p>
  
  <p>Bedrooms: 3 </p>
  
  <p>Bathsroom 4"</p>
  
  <p>will get read as "Houses: 2Bedrooms: 3Bathsroom 4"</p>
  
  <p>I've searched through all of the examples to no avail. I've also tried LocationTextExtractionStrategy to no avail. I've tried using the .split method and no help.</p>
  
  <pre><code>Public Shared Function ParseAllPdfText(ByVal filepath As String) 
      Dim sbtxt, currenttext As String
  
      sbtxt = ""
      Try
  
          Using reader As New PdfReader(filepath)
  
              For intPages As Integer = 1 To reader.NumberOfPages
  
                  currenttext = PdfTextExtractor.GetTextFromPage(reader, intPages, New LocationTextExtractionStrategy())
                  currenttext = Encoding.UTF8.GetString(ASCIIEncoding.Convert(Encoding.[Default], Encoding.UTF8, Encoding.[Default].GetBytes(currenttext)))
                  sbtxt = sbtxt &amp; currenttext &amp; vbcrlf
  
              Next
  
          End Using
  
      Catch ex As Exception
          MsgBox(" There was an error extracting text from the file: " &amp; ex.Message, vbInformation, "Error Extracting Text")
  
      End Try
      Return sbtxt
  </code></pre>