If I follow correctly, you want to get the OCR'd text from each page of a document in a repository and read the text into a string. If so, here is a bare-bones code snippet that will open a repository, retrieve a reference to a document, and read the text of each page into a List(Of String) object.
Dim pageText As List(Of String) = New List(Of String)
Dim raSession As Session = New Session
'Open the session and login...
raSession.Connect(New RepositoryRegistration("SAMANTHA-PC", "LFMAIN"))
raSession.LogIn("admin", "admin")
'Get a reference to the Document...
Dim docInfo As DocumentInfo = Document.GetDocumentInfo(96960, raSession)
'Instantiate a new PageInfoReader...
Dim pageReader As PageInfoReader = docInfo.GetPageInfos
'Step through each page of the document and read the text into the list...
For Each pInfo As PageInfo In pageReader
Using reader As StreamReader = pInfo.ReadTextPagePart
pageText.Add(reader.ReadLine)
End Using
Next
'Cleanup...
pageReader.Close()
docInfo.Dispose()
raSession.Close()
Note: You could even omit instantiating the DocumentInfo object if you don't need it in the routine and instead instantiate the PageInfoReader like this;
'Instantiate a new PageInfoReader...
Dim pageReader As PageInfoReader = Document.GetDocumentInfo(96960, raSession).GetPageInfos
But some might say that it is a little harder to follow what is happening...