Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
python-docx 1.2.1 documentation
python-docx 1.2.1 documentation
  • Installing
  • Quickstart
  • Working with Documents
  • Working with Tables
  • Working with Text
  • Working with Sections
  • Working with Headers and Footers
  • API basics
  • Understanding Styles
  • Working with Styles
  • Working with Comments
  • Understanding pictures and other shapes
  • Document objects
  • Document Settings objects
  • Style-related objects
  • Text-related objects
  • Table objects
  • Section objects
  • Comment-related objects
  • Shape-related objects
  • DrawingML objects
  • Shared classes
  • Enumerations
    • MSO_COLOR_TYPE
    • MSO_THEME_COLOR_INDEX
    • WD_PARAGRAPH_ALIGNMENT
    • WD_BUILTIN_STYLE
    • WD_CELL_VERTICAL_ALIGNMENT
    • WD_COLOR_INDEX
    • WD_LINE_SPACING
    • WD_ORIENTATION
    • WD_TABLE_ALIGNMENT
    • WD_ROW_HEIGHT_RULE
    • WD_SECTION_START
    • WD_STYLE_TYPE
    • WD_TAB_ALIGNMENT
    • WD_TAB_LEADER
    • WD_TABLE_DIRECTION
    • WD_UNDERLINE
  • Analysis
    • Comments
    • Header and Footer
    • Settings part
    • Text
      • Hyperlink
      • Tab Stops
      • Font highlight color
      • Paragraph formatting
      • Font
      • Font Color
      • Underline
      • Run-level content
      • Breaks
    • Table
      • Table Properties
      • Table Row
      • Table Cell
      • Table - Merge Cells
    • Styles
      • Styles collection
      • Style objects
      • Paragraph Style
      • Character Style
      • Latent Styles
    • Shapes (in general)
      • Inline shape
      • Inline shape size
      • Picture
    • Core Document Properties
    • Numbering Part
    • Sections
    • CT_Document
    • CT_Body
    • CT_P
Back to top
View this page

Shape-related objects¶

InlineShapes objects¶

class docx.shape.InlineShapes(body_elm: CT_Body, parent: StoryPart)[source]¶

Sequence of InlineShape instances, supporting len(), iteration, and indexed access.

InlineShape objects¶

The width and height property of InlineShape provide a length object that is an instance of Length. These instances behave like an int, but also have built-in units conversion properties, e.g.:

>>> inline_shape.height
914400
>>> inline_shape.height.inches
1.0
class docx.shape.InlineShape(inline: CT_Inline)[source]¶

Proxy for an <wp:inline> element, representing the container for an inline graphical object.

property height: Length¶

Read/write.

The display height of this inline shape as an Emu instance.

property type¶

The type of this inline shape as a member of docx.enum.shape.WD_INLINE_SHAPE, e.g. LINKED_PICTURE.

Read-only.

property width¶

Read/write.

The display width of this inline shape as an Emu instance.

Next
DrawingML objects
Previous
Comment-related objects
Copyright © 2013, Steve Canny
Made with Sphinx and @pradyunsg's Furo
On this page
  • Shape-related objects
    • InlineShapes objects
      • InlineShapes
    • InlineShape objects
      • InlineShape
        • InlineShape.height
        • InlineShape.type
        • InlineShape.width