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

NameTypeAccessDescription
typestrReadGets the type.
shape_typeint | NoneReadGets the shape type.
namestrReadGets the name.
alternative_textstrReadGets the alternative text.
widthfloat | NoneReadGets the width.
heightfloat | NoneReadGets the height.
is_inlinebool | NoneReadGets the is inline.
has_imagebool | NoneReadGets the has image.
image_dataOptional[ImageData]ReadGets the image data.
text_boxdict[str, Any] | NoneReadGets the text box.
fill_colorstrReadGets the fill color.
strokeOptional[Border]ReadGets the stroke.
text_box_anchorintReadGets the text box anchor.
wrap_typeintReadGets the wrap type.
relative_horizontal_positionintReadGets the relative horizontal position.
relative_vertical_positionintReadGets the relative vertical position.
leftfloatReadGets the left.
topfloatReadGets the top.
horizontal_alignmentintReadGets the horizontal alignment.
vertical_alignmentintReadGets the vertical alignment.
behind_textboolReadGets the behind text.
allow_overlapboolReadGets the allow overlap.
is_layout_in_cellboolReadGets the is layout in cell.
anchor_lockedboolReadGets the anchor locked.

Methods

SignatureDescription
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.

See Also