Paragraph
概述
Paragraph 是 Aspose.Words FOSS 用于 Python 的一个类。继承自:BaseModel,NodeCastMixin。
一个段落,其子项 — Run,BookmarkStart / BookmarkEnd,
``FieldStart`` / ``FieldSeparator`` / ``FieldEnd`` and inline ``Shape`` —
sit in a single ordered collection in document order.此类提供了 10 个方法,用于在 Python 程序中处理 Paragraph 对象。可用的方法包括:as_body、as_cell、as_paragraph、as_row、as_run、as_section、as_shape、as_table、get_child_nodes、get_text。在安装了 Aspose.Words FOSS for Python 包后,所有公共成员对任何 Python 应用程序均可访问。属性:frame_format、list_format、list_label、paragraph_break_font、paragraph_format、runs,以及另外 2 项。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
text | str | 读取 | 所有 Run 子项的连接文本。 |
runs | list[Run] | 读取 | 在文档中,对段落的 Run 子项的类型化视图 |
order. || paragraph_break_font | Optional[Font] | 读/写 | Aspose.Words 在 Paragraph 上公开此项;存储位于 |
``ParagraphFormat`` for style-chain merging. || frame_format | Optional["FrameFormat"] | 读取 | Aspose.Words 在 Paragraph 上公开此项;存储位于 |
``ParagraphFormat`` for style-chain merging. || type | Literal["Paragraph"] | 读取 | 获取类型。 | | paragraph_format | ParagraphFormat | 读取 | 获取段落格式。 | | list_format | ListFormat \| None | 读取 | 获取列表格式。 | | list_label | Optional[ListLabel] | 读取 | 获取列表标签。 |
方法
| 签名 | 描述 |
|---|---|
get_text() → str | 文本加段落标记,正如 aspose.words 返回的那样。 |
get_child_nodes(node_type: int, deep: bool) → list | 子节点,可选地通过 :class:NodeType 进行过滤。 |
as_body() | 在此 Paragraph 实例上调用 as_body。 |
as_cell() | 在此 Paragraph 实例上调用 as_cell。 |
as_paragraph() | 在此 Paragraph 实例上调用 as_paragraph。 |
as_row() | 在此 Paragraph 实例上调用 as_row。 |
as_run() | 在此 Paragraph 实例上调用 as_run。 |
as_section() | 在此 Paragraph 实例上调用 as_section。 |
as_shape() | 在此 Paragraph 实例上调用 as_shape。 |
as_table() | 在此 Paragraph 实例上调用 as_table。 |