Paper Office
paper-pptxAPI referenceoxml.shapes.graphfrm

CT_GraphicalObjectFrame

paper-pptx 0.2.0 API reference

p:graphicFrame element.

A container for a table, a chart, or another graphical object.

Attributes

chart

attributechartCT_Chart | None

The c:chart great-grandchild element, or None if not present.

chart_rId

attributechart_rIdstr | None

The rId attribute of the c:chart great-grandchild element.

None if not present.

cx

attributecxLength

cy

attributecyLength

flipH

attributeflipH

flipV

attributeflipV

graphic

attributegraphicCT_GraphicalObject
= OneAndOnlyOne('a:graphic')

graphicData

attributegraphicDataCT_GraphicalObjectData

a:graphicData grandchild of this graphic-frame element.

graphicData_uri

attributegraphicData_uristr

str value of uri attribute of a:graphicData grandchild.

has_oleobj

attributehas_oleobjbool

True for graphicFrame containing an OLE object, False otherwise.

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:graphicFrame element does not enclose an OLE object. True indicates an embedded OLE object and False indicates a linked OLE object.

nvGraphicFramePr

attributenvGraphicFramePrCT_GraphicalObjectFrameNonVisual
= OneAndOnlyOne('p:nvGraphicFramePr')

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.

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

spPr

attributespPrCT_ShapeProperties

txBody

attributetxBody

Child p:txBody element, None if not present.

x

attributexLength

xfrm

attributexfrmCT_Transform2D
= OneAndOnlyOne('p:xfrm')

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() -> CT_Transform2D

Return the required p:xfrm child element.

Overrides version on BaseShapeElement.

Returns

pptx.oxml.shapes.shared.CT_Transform2D

insert_element_before

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

new_chart_graphicFrame

funcnew_chart_graphicFrame(id_: int, name: str, rId: str, x: int, y: int, cx: int, cy: int) -> CT_GraphicalObjectFrame

Return a p:graphicFrame element tree populated with a chart element.

paramid_int
paramnamestr
paramrIdstr
paramxint
paramyint
paramcxint
paramcyint

Returns

pptx.oxml.shapes.graphfrm.CT_GraphicalObjectFrame

new_graphicFrame

funcnew_graphicFrame(id_: int, name: str, x: int, y: int, cx: int, cy: int) -> CT_GraphicalObjectFrame

Return a new p:graphicFrame element tree suitable for containing a table or chart.

Note that a graphicFrame element is not a valid shape until it contains a graphical object such as a table.

paramid_int
paramnamestr
paramxint
paramyint
paramcxint
paramcyint

Returns

pptx.oxml.shapes.graphfrm.CT_GraphicalObjectFrame

new_ole_object_graphicFrame

funcnew_ole_object_graphicFrame(id_: int, name: str, ole_object_rId: str, progId: str, icon_rId: str, x: int, y: int, cx: int, cy: int, imgW: int, imgH: int) -> CT_GraphicalObjectFrame

Return newly-created p:graphicFrame for embedded OLE-object.

ole_object_rId identifies the relationship to the OLE-object part.

progId is a str identifying the object-type in terms of the application (program) used to open it. This becomes an attribute of the same name in the p:oleObj element.

icon_rId identifies the relationship to an image part used to display the OLE-object as an icon (vs. a preview).

paramid_int
paramnamestr
paramole_object_rIdstr
paramprogIdstr
paramicon_rIdstr
paramxint
paramyint
paramcxint
paramcyint
paramimgWint
paramimgHint

Returns

pptx.oxml.shapes.graphfrm.CT_GraphicalObjectFrame

new_table_graphicFrame

funcnew_table_graphicFrame(id_: int, name: str, rows: int, cols: int, x: int, y: int, cx: int, cy: int) -> CT_GraphicalObjectFrame

Return a p:graphicFrame element tree populated with a table element.

paramid_int
paramnamestr
paramrowsint
paramcolsint
paramxint
paramyint
paramcxint
paramcyint

Returns

pptx.oxml.shapes.graphfrm.CT_GraphicalObjectFrame

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