PlainTextDocument Class
Allows to extract plain-text representation of the document's content.
Inheritance Hierarchy
SystemObject
  Aspose.WordsPlainTextDocument

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.11
Syntax
public class PlainTextDocument

The PlainTextDocument type exposes the following members.

Constructors
  NameDescription
Public methodCode examplePlainTextDocument(Stream)
Creates a plain text document from a stream. Automatically detects the file format.
Public methodCode examplePlainTextDocument(String)
Creates a plain text document from a file. Automatically detects the file format.
Public methodCode examplePlainTextDocument(Stream, LoadOptions)
Creates a plain text document from a stream. Allows to specify additional options such as an encryption password.
Public methodCode examplePlainTextDocument(String, LoadOptions)
Creates a plain text document from a file. Allows to specify additional options such as an encryption password.
Properties
  NameDescription
Public propertyCode exampleBuiltInDocumentProperties
Gets BuiltInDocumentProperties of the document.
Public propertyCode exampleCustomDocumentProperties
Gets CustomDocumentProperties of the document.
Public propertyCode exampleText
Gets textual content of the document concatenated as a string.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Examples
Show how to simply extract text from a document.
TxtLoadOptions loadOptions = new TxtLoadOptions { DetectNumberingWithWhitespaces = false };

PlainTextDocument plaintext = new PlainTextDocument(MyDir + "Bookmark.docx");

plaintext = new PlainTextDocument(MyDir + "Bookmark.docx", loadOptions);
See Also