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
| Name | Type | Access | Description |
|---|---|---|---|
all_paragraphs | list[Paragraph] | Read | Flat list of direct body paragraphs only (excludes table cells). |
tables | list[Table] | Read | Flat list of all top-level tables in the body. |
all_tables | list[Table] | Read | Alias for tables (backwards compatibility). |
text | str | Read | Plain text of the whole document (body paragraphs only). |
type | str | Read | Gets the type. |
default_tab_stop | float | Read | Gets the default tab stop. |
page_color | str | Read | Gets the page color. |
page_count | int | Read | Gets the page count. |
styles | list[Style] | Read | Gets the styles. |
lists | list[DocList] | Read | Gets the lists. |
sections | list[Section] | Read | Gets the sections. |
header_paragraphs | list[Paragraph] | Read | Gets the header paragraphs. |
footer_paragraphs | list[Paragraph] | Read | Gets the footer paragraphs. |
Methods
| Signature | Description |
|---|---|
find_style(name: str) → Style | None | Look up a style by its exact name. |
headings(max_level: int) → list[Paragraph] | All heading paragraphs up to a given outline level. |