ParserGetFormattedText Method (FormattedTextOptions)
Extracts a formatted text from the document.

Namespace: GroupDocs.Parser
Assembly: GroupDocs.Parser (in GroupDocs.Parser.dll) Version: 20.8.0
Syntax
public TextReader GetFormattedText(
	FormattedTextOptions options
)

Parameters

options
Type: GroupDocs.Parser.OptionsFormattedTextOptions
The formatted text extraction options.

Return Value

Type: TextReader
An instance of TextReader class with the extracted text; null if formatted text extraction isn't supported.
Remarks
Learn more:
Examples

The following example shows how to extract a document text as HTML text:

C#
// Create an instance of Parser class
using (Parser parser = new Parser(filePath))
{
    // Extract a formatted text into the reader
    using (TextReader reader = parser.GetFormattedText(new FormattedTextOptions(FormattedTextMode.Html)))
    {
        // Print a formatted text from the document
        // If formatted text extraction isn't supported, a reader is null
        Console.WriteLine(reader == null ? "Formatted text extraction isn't suppported" : reader.ReadToEnd());
    }
}
See Also