Last active
September 30, 2019 07:17
-
-
Save GroupDocsGists/1abb5d9bf8336ff30a9791636e9eda3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an instance of Parser class | |
using (Parser parser = new Parser(filePath)) | |
{ | |
// Extract text to the reader | |
using (TextReader reader = parser.GetText()) | |
{ | |
// Check if text extraction is supported | |
if (reader == null) | |
{ | |
Console.WriteLine("Text extraction isn't supported."); | |
return; | |
} | |
string textLine = null; | |
do | |
{ | |
textLine = reader.ReadLine(); | |
if (textLine != null) | |
{ | |
Console.WriteLine(textLine); | |
} | |
} | |
while (textLine != null); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an extractor factory | |
ExtractorFactory factory = new ExtractorFactory(); | |
// Create a text extractor | |
using (TextExtractor extractor = factory.CreateTextExtractor(filePath)) | |
{ | |
// Extract text from the text extractor | |
string textLine = null; | |
do | |
{ | |
textLine = extractor.ExtractLine(); | |
if (textLine != null) | |
{ | |
Console.WriteLine(textLine); | |
} | |
} | |
while (textLine != null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment