Paper Office
paper-pptxAPI referenceshapes.placeholder

PicturePlaceholder

paper-pptx 0.2.0 API reference

Placeholder shape that can only accept a picture.

Attributes

adjustments

attributeadjustmentsAdjustmentCollection

Read-only reference to AdjustmentCollection instance for this shape.

auto_shape_type

attributeauto_shape_type

Enumeration value identifying the type of this auto shape.

Like MSO_SHAPE.ROUNDED_RECTANGLE. Raises ValueError if this shape is not an auto shape.

click_action

attributeclick_actionActionSetting

ActionSetting instance providing access to click behaviors.

Click behaviors are hyperlink-like behaviors including jumping to a hyperlink (web page) or to another slide in the presentation. The click action is that defined on the overall shape, not a run of text within the shape. An ActionSetting object is always returned, even when no click behavior is defined on the shape.

element

attributeelementShapeElement

lxml element for this shape, e.g. a CT_Shape instance.

Note that manipulating this element improperly can produce an invalid presentation file. Make sure you know what you're doing if you use this to change the underlying XML.

fill

attributefill

FillFormat instance for this shape.

Provides access to fill properties such as fill color.

has_chart

attributehas_chartbool

True if this shape is a graphic frame containing a chart object.

False otherwise. When True, the chart object can be accessed using the .chart property.

has_table

attributehas_tablebool

True if this shape is a graphic frame containing a table object.

False otherwise. When True, the table object can be accessed using the .table property.

has_text_frame

attributehas_text_framebool

True if this shape can contain text. Always True for an AutoShape.

height

attributeheight

The effective height of this placeholder shape; its directly-applied height if it has one, otherwise the height of its parent layout placeholder.

is_placeholder

attributeis_placeholder

Boolean indicating whether this shape is a placeholder. Unconditionally True in this case.

left

attributeleft

The effective left of this placeholder shape; its directly-applied left if it has one, otherwise the left of its parent layout placeholder.

line

attributeline

LineFormat instance for this shape.

Provides access to line properties such as line color.

ln

attributeln

The a:ln element containing the line format properties such as line color and width.

None if no a:ln element is present.

name

attributenamestr

Name of this shape, e.g. 'Picture 7'.

part

attributepartBaseSlidePart

The package part containing this shape.

A BaseSlidePart subclass in this case. Access to a slide part should only be required if you are extending the behavior of pp API objects.

placeholder_format

attributeplaceholder_format_PlaceholderFormat

Provides access to placeholder-specific properties such as placeholder type.

Raises ValueError on access if the shape is not a placeholder.

rotation

attributerotationfloat

Degrees of clockwise rotation.

Read/write float. Negative values can be assigned to indicate counter-clockwise rotation, e.g. assigning -45.0 will change setting to 315.0.

shadow

attributeshadowShadowFormat

ShadowFormat object providing access to shadow for this shape.

A ShadowFormat object is always returned, even when no shadow is explicitly defined on this shape (i.e. it inherits its shadow behavior).

shape_id

attributeshape_idint

Read-only positive integer identifying this shape.

The id of a shape is unique among all shapes on a slide.

shape_type

attributeshape_type

Member of :ref:MsoShapeType specifying the type of this shape. Unconditionally MSO_SHAPE_TYPE.PLACEHOLDER in this case. Read-only.

text

attributetextstr

Read/write. Text in shape as a single string.

The returned string will contain a newline character ("\n") separating each paragraph and a vertical-tab ("\v") character for each line break (soft carriage return) in the shape's text.

Assignment to text replaces any text previously contained in the shape, along with any paragraph or font formatting applied to it. A newline character ("\n") in the assigned text causes a new paragraph to be started. A vertical-tab ("\v") character in the assigned text causes a line-break (soft carriage-return) to be inserted. (The vertical-tab character appears in clipboard text copied from PowerPoint as its str encoding of line-breaks.)

text_frame

attributetext_frame

TextFrame instance for this shape.

Contains the text of the shape and provides access to text formatting properties.

top

attributetop

The effective top of this placeholder shape; its directly-applied top if it has one, otherwise the top of its parent layout placeholder.

width

attributewidth

The effective width of this placeholder shape; its directly-applied width if it has one, otherwise the width of its parent layout placeholder.

Functions

get_or_add_ln

funcget_or_add_ln()

Return the a:ln element containing the line format properties XML for this shape.

insert_picture

funcinsert_picture(image_file)

Return a PlaceholderPicture object depicting the image in image_file.

image_file may be either a path (string) or a file-like object. The image is cropped to fill the entire space of the placeholder. A PlaceholderPicture object has all the properties and methods of a Picture shape except that the value of its :attr:~._BaseSlidePlaceholder.shape_type property is MSO_SHAPE_TYPE.PLACEHOLDER instead of MSO_SHAPE_TYPE.PICTURE.

paramimage_file

On this page