Shape
Overview
Shape is a class in Aspose.Words FOSS for Python.
Inherits from: BaseModel, NodeCastMixin.
Shape objects expose geometry and content properties such as width, height, image_data and text_box, and can be cast to other node types via as_body(), as_paragraph(), etc.
This class provides 8 methods for working with Shape objects in Python programs.
Available methods include: as_body, as_cell, as_paragraph, as_row, as_run, as_section, as_shape, as_table.
All public members are accessible to any Python application after installing the Aspose.Words FOSS for Python package.
Properties: allow_overlap, alternative_text, anchor_locked, behind_text, fill_color, has_image, and 18 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
type | str | Read | Gets the type. |
shape_type | int | None | Read | Gets the shape type. |
name | str | Read | Gets the name. |
alternative_text | str | Read | Gets the alternative text. |
width | float | None | Read | Gets the width. |
height | float | None | Read | Gets the height. |
is_inline | bool | None | Read | Gets the is inline. |
has_image | bool | None | Read | Gets the has image. |
image_data | Optional[ImageData] | Read | Gets the image data. |
text_box | dict[str, Any] | None | Read | Gets the text box. |
fill_color | str | Read | Gets the fill color. |
stroke | Optional[Border] | Read | Gets the stroke. |
text_box_anchor | int | Read | Gets the text box anchor. |
wrap_type | int | Read | Gets the wrap type. |
relative_horizontal_position | int | Read | Gets the relative horizontal position. |
relative_vertical_position | int | Read | Gets the relative vertical position. |
left | float | Read | Gets the left. |
top | float | Read | Gets the top. |
horizontal_alignment | int | Read | Gets the horizontal alignment. |
vertical_alignment | int | Read | Gets the vertical alignment. |
behind_text | bool | Read | Gets the behind text. |
allow_overlap | bool | Read | Gets the allow overlap. |
is_layout_in_cell | bool | Read | Gets the is layout in cell. |
anchor_locked | bool | Read | Gets the anchor locked. |
Methods
| Signature | Description |
|---|---|
as_body() | Calls as_body on this Shape instance. |
as_cell() | Calls as_cell on this Shape instance. |
as_paragraph() | Calls as_paragraph on this Shape instance. |
as_row() | Calls as_row on this Shape instance. |
as_run() | Calls as_run on this Shape instance. |
as_section() | Calls as_section on this Shape instance. |
as_shape() | Calls as_shape on this Shape instance. |
as_table() | Calls as_table on this Shape instance. |