Paper Office
paper-pptxAPI referenceoxml.shapes.graphfrm

CT_GraphicalObjectData

paper-pptx 0.2.0 API reference

p:graphicData element.

The direct container for a table, a chart, or another graphical object.

Attributes

blob_rId

attributeblob_rIdstr | None

Optional r:id attribute value of p:oleObj descendent element.

This value is None when this p:graphicData element does not enclose an OLE object. This value could also be None if an enclosed OLE object does not specify this attribute (it is specified optional in the schema) but so far, all OLE objects we've encountered specify this value.

chart

attributechartCT_Chart | None
= ZeroOrOne('c:chart')

cx

attributecxLength

cy

attributecyLength

flipH

attributeflipH

flipV

attributeflipV

has_ph_elm

attributehas_ph_elm

True if this shape element has a p:ph descendant, indicating it is a placeholder shape. False otherwise.

is_embedded_ole_obj

attributeis_embedded_ole_objbool | None

Optional boolean indicating an embedded OLE object.

Returns None when this p:graphicData element does not enclose an OLE object. True indicates an embedded OLE object and False indicates a linked OLE object.

ph

attributephCT_Placeholder | None

The p:ph descendant element if there is one, None otherwise.

ph_idx

attributeph_idxint

Integer value of placeholder idx attribute.

Raises ValueError if shape is not a placeholder.

ph_orient

attributeph_orientstr

Placeholder orientation, e.g. 'vert'.

Raises ValueError if shape is not a placeholder.

ph_sz

attributeph_szstr

Placeholder size, e.g. ST_PlaceholderSize.HALF.

Raises ValueError if shape is not a placeholder.

ph_type

attributeph_type

Placeholder type, e.g. ST_PlaceholderType.TITLE ('title').

Raises ValueError if shape is not a placeholder.

progId

attributeprogIdstr | None

Optional str value of "progId" attribute of p:oleObj descendent.

This value identifies the "type" of the embedded object in terms of the application used to open it.

This value is None when this p:graphicData element does not enclose an OLE object. This could also be None if an enclosed OLE object does not specify this attribute (it is specified optional in the schema) but so far, all OLE objects we've encountered specify this value.

rot

attributerotfloat

Float representing degrees this shape is rotated clockwise.

shape_id

attributeshape_id

Integer id of this shape

shape_name

attributeshape_name

Name of this shape

showAsIcon

attributeshowAsIconbool | None

Optional value of "showAsIcon" attribute value of p:oleObj descendent.

This value is None when this p:graphicData element does not enclose an OLE object. It is False when the showAsIcon attribute is omitted on the p:oleObj element.

spPr

attributespPrCT_ShapeProperties

tbl

attributetblCT_Table | None
= ZeroOrOne('a:tbl')

txBody

attributetxBody

Child p:txBody element, None if not present.

uri

attributeuristr
= RequiredAttribute('uri', XsdString)

x

attributexLength

xfrm

attributexfrm

The a:xfrm grandchild element or None if not found.

This version works for p:sp, p:cxnSp, and p:pic elements, others will need to override.

xml

attributexmlstr

XML string for this element, suitable for testing purposes.

Pretty printed for readability and without an XML declaration at the top.

y

attributeyLength

Functions

first_child_found_in

funcfirst_child_found_in(*tagnames: str) -> _Element | None

First child with tag in tagnames, or None if not found.

paramtagnamesstr
= ()

Returns

lxml.etree._Element | None

get_or_add_xfrm

funcget_or_add_xfrm()

Return the a:xfrm grandchild element, newly-added if not present.

This version works for p:sp, p:cxnSp, and p:pic elements, others will need to override.

insert_element_before

funcinsert_element_before(elm: ElementBase, *tagnames: str)
paramelmElementBase
paramtagnamesstr
= ()

remove_all

funcremove_all(*tagnames: str) -> None

Remove child elements with tagname (e.g. "a:p") in tagnames.

paramtagnamesstr
= ()

Returns

None

xpath

funcxpath(xpath_str: str) -> Any

Override of lxml _Element.xpath() method.

Provides standard Open XML namespace mapping (nsmap) in centralized location.

paramxpath_strstr

Returns

typing.Any

On this page