Paragraph

Overview

Paragraph is a class in Aspose.Words FOSS for Python. Inherits from: BaseModel, NodeCastMixin.

A paragraph whose children — Run, BookmarkStart / BookmarkEnd,

``FieldStart`` / ``FieldSeparator`` / ``FieldEnd`` and inline ``Shape`` —

sit in a single ordered collection in document order.

This class provides 10 methods for working with Paragraph objects in Python programs. Available methods include: as_body, as_cell, as_paragraph, as_row, as_run, as_section, as_shape, as_table, get_child_nodes, get_text. All public members are accessible to any Python application after installing the Aspose.Words FOSS for Python package. Properties: frame_format, list_format, list_label, paragraph_break_font, paragraph_format, runs, and 2 more.

Properties

NameTypeAccessDescription
textstrReadConcatenated text of all Run children.
runslist[Run]ReadTyped view over the paragraph’s Run children, in document
    order. |

| paragraph_break_font | Optional[Font] | Read/Write | Aspose.Words exposes this on Paragraph; storage lives on

    ``ParagraphFormat`` for style-chain merging. |

| frame_format | Optional["FrameFormat"] | Read | Aspose.Words exposes this on Paragraph; storage lives on

    ``ParagraphFormat`` for style-chain merging. |

| type | Literal["Paragraph"] | Read | Gets the type. | | paragraph_format | ParagraphFormat | Read | Gets the paragraph format. | | list_format | ListFormat \| None | Read | Gets the list format. | | list_label | Optional[ListLabel] | Read | Gets the list label. |

Methods

SignatureDescription
get_text()strText plus the paragraph mark, as aspose.words returns it.
get_child_nodes(node_type: int, deep: bool)listChild nodes, optionally filtered by :class:NodeType.
as_body()Calls as_body on this Paragraph instance.
as_cell()Calls as_cell on this Paragraph instance.
as_paragraph()Calls as_paragraph on this Paragraph instance.
as_row()Calls as_row on this Paragraph instance.
as_run()Calls as_run on this Paragraph instance.
as_section()Calls as_section on this Paragraph instance.
as_shape()Calls as_shape on this Paragraph instance.
as_table()Calls as_table on this Paragraph instance.

See Also

 English