text property
PlainTextDocument.text property
Gets textual content of the document concatenated as a string.
@property
def text(self) -> str:
...
Examples
Shows how to load the contents of a Microsoft Word document in plaintext.
doc = aw.Document()
builder = aw.DocumentBuilder(doc)
builder.writeln("Hello world!")
doc.save(ARTIFACTS_DIR + "PlainTextDocument.load.docx")
plaintext = aw.PlainTextDocument(ARTIFACTS_DIR + "PlainTextDocument.load.docx")
self.assertEqual("Hello world!", plaintext.text.strip())
See Also
- module aspose.words
- class PlainTextDocument