FormattedTextOptions class

FormattedTextOptions class

Provides the options which are used for formatted text extraction.

An instance of FormattedTextOptions is used as a parameter in Parser.get_formatted_text and Parser.get_formatted_text methods. See the usage examples there.

  • Extract formatted text from document
  • Extract a document text as HTML
  • Extract a document text as Markdown
  • Extract a document text as Plain text

The FormattedTextOptions type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the FormattedTextOptions class.
init Initializes a new FormattedTextOptions instance.

Properties

Property Description
mode The formatted text extraction mode.

Example

from groupdocs.parser import Parser
from groupdocs.parser.options import FormattedTextOptions, FormattedTextMode

with Parser("sample.pptx") as parser:
    # Extract formatted text as Markdown (HTML and PLAIN_TEXT modes are also available)
    reader = parser.get_formatted_text(FormattedTextOptions(FormattedTextMode.MARKDOWN))
    print(reader.read_to_end() if reader is not None else "Formatted text isn't available.")

See Also