Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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);
}
}
// 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
You can’t perform that action at this time.