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.9
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
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Examples
Show how to simply extract text from a document.
[C#]

TxtLoadOptions loadOptions = new TxtLoadOptions { DetectNumberingWithWhitespaces = false };

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

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