PlainTextDocument Constructor (Stream, LoadOptions) |
Namespace: Aspose.Words
Exception | Condition |
---|---|
UnsupportedFileFormatException | The document format is not recognized or not supported. |
FileCorruptedException | The document appears to be corrupted and cannot be loaded. |
Exception | There is a problem with the document and it should be reported to Aspose.Words developers. |
IOException | There is an input/output exception. |
IncorrectPasswordException | The document is encrypted and requires a password to open, but you supplied an incorrect password. |
ArgumentNullException | The stream cannot be null. |
NotSupportedException | The stream does not support reading or seeking. |
ObjectDisposedException | The stream is a disposed object. |
The document must be stored at the beginning of the stream. The stream must support random positioning.
TxtLoadOptions loadOptions = new TxtLoadOptions { DetectNumberingWithWhitespaces = false }; Stream stream = new FileStream(MyDir + "Document.docx", FileMode.Open); PlainTextDocument plaintext = new PlainTextDocument(stream); plaintext = new PlainTextDocument(stream, loadOptions);