Document

Overview

Document is a class in Aspose.Words FOSS for Python. Inherits from: BaseModel.

The Document class represents a Word document and provides the get_text() method to extract the full plain‑text content of the file.

This class provides 2 methods for working with Document objects in Python programs. Available methods include: find_style, headings. All public members are accessible to any Python application after installing the Aspose.Words FOSS for Python package. Properties: all_paragraphs, all_tables, default_tab_stop, footer_paragraphs, header_paragraphs, lists, and 7 more.

Properties

NameTypeAccessDescription
all_paragraphslist[Paragraph]ReadFlat list of direct body paragraphs only (excludes table cells).
tableslist[Table]ReadFlat list of all top-level tables in the body.
all_tableslist[Table]ReadAlias for tables (backwards compatibility).
textstrReadPlain text of the whole document (body paragraphs only).
typestrReadGets the type.
default_tab_stopfloatReadGets the default tab stop.
page_colorstrReadGets the page color.
page_countintReadGets the page count.
styleslist[Style]ReadGets the styles.
listslist[DocList]ReadGets the lists.
sectionslist[Section]ReadGets the sections.
header_paragraphslist[Paragraph]ReadGets the header paragraphs.
footer_paragraphslist[Paragraph]ReadGets the footer paragraphs.

Methods

SignatureDescription
find_style(name: str)Style | NoneLook up a style by its exact name.
headings(max_level: int)list[Paragraph]All heading paragraphs up to a given outline level.

See Also

 English