Skip to content

pptxlib.shape

source module pptxlib.shape

source dataclass Color(api: DispatchBaseClass | CoClassBaseClass)

Bases : Base

Methods

source property Color.color: int

source property Color.alpha: float

source property Color.visible: bool

source method Color.set(color: int | str | tuple[int, int, int] | None = None, alpha: float | None = None, visible: bool | None = None)Self

source method Color.update(color: Color)None

source dataclass Fill(api: DispatchBaseClass | CoClassBaseClass)

Bases : Color

source dataclass Line(api: DispatchBaseClass | CoClassBaseClass)

source property Line.weight: float

source method Line.set(weight: float | None = None, color: int | str | tuple[int, int, int] | None = None, alpha: float | None = None)Self

source method Line.update(line: Line)None

source property Line.dash_style: int

source method Line.dash(dash_style: int | str = 'Dash')Self

source property Line.begin_arrowhead_style: int

source property Line.end_arrowhead_style: int

source property Line.begin_arrowhead_length: int

source property Line.end_arrowhead_length: int

source property Line.begin_arrowhead_width: int

source property Line.end_arrowhead_width: int

source method Line.begin_arrow(style: int | str | None = None, length: int | str | None = None, width: int | str | None = None)Self

source method Line.end_arrow(style: int | str | None = None, length: int | str | None = None, width: int | str | None = None)Self

source dataclass Shape(api: DispatchBaseClass | CoClassBaseClass, parent: Slide, collection: Shapes)

source property Shape.left: float

source property Shape.top: float

source property Shape.width: float

source property Shape.height: float

source property Shape.text_range: DispatchBaseClass

source property Shape.text: str

source property Shape.font: Font

source property Shape.fill: Fill

source property Shape.line: Line

source method Shape.select(*, replace: bool = True)ShapeRange

source method Shape.copy()None

source method Shape.connect(shape: Shape, direction: str = 'horizontal')Shape

source method Shape.export(file_name: str | Path, fmt: str | int | None = None)None

source method Shape.png()bytes

source method Shape.svg()str

source method Shape.align_center()Self

source method Shape.text_margin(left: float = 0, top: float = 0, right: float | None = None, bottom: float | None = None)Self

source dataclass Shapes(api: DispatchBaseClass | CoClassBaseClass, parent: Slide)

source property Shapes.title: Shape

source method Shapes.add(kind: int | str, left: float, top: float, width: float, height: float, text: str = '')Shape

source method Shapes.add_line(begin_x: float, begin_y: float, end_x: float, end_y: float)Shape

source method Shapes.add_label(text: str, left: float, top: float, width: float = 72, height: float = 72, *, auto_size: bool = True)Shape

source method Shapes.add_table(num_rows: int, num_columns: int, left: float = 100, top: float = 100, width: float = 100, height: float = 100)Table

source method Shapes.add_picture(file_name: str | Path, left: float = 0, top: float = 0, width: float = -1, height: float = -1, scale: float | None = None)Shape

source method Shapes.add_image(image: Image, left: float = 0, top: float = 0, width: float = -1, height: float = -1, scale: float | None = None)Shape

source method Shapes.add_figure(fig: Figure, left: float = 0, top: float = 0, width: float = -1, height: float = -1, scale: float | None = None, dpi: int | Literal['figure'] = 'figure', transparent: bool | None = None)Shape

source method Shapes.add_connector(shape1: Shape, shape2: Shape, direction: str = 'horizontal')Shape

source method Shapes.paste(left: float | None = None, top: float | None = None, width: float | None = None, height: float | None = None)Shape

source method Shapes.paste_special(data_type: int | str = 0, left: float | None = None, top: float | None = None, width: float | None = None, height: float | None = None)Shape

Parameters

  • data_type : int 0: ppPasteDefault 1: ppPasteBitmap 2: ppPasteEnhancedMetafile 4: ppPasteGIF 8: ppPasteHTML 5: ppPasteJPG 3: ppPasteMetafilePicture 10: ppPasteOLEObject 6: ppPastePNG 9: ppPasteRTF 11: ppPasteShape 7: ppPasteText

source method Shapes.range(shapes: Iterable[Shape])ShapeRange

source dataclass ShapeRange(api: DispatchBaseClass | CoClassBaseClass, parent: Slide, collection: Shapes)

Bases : Shape