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 | NoneThe c:chart great-grandchild element, or None if not present.
chart_rId
attributechart_rIdstr | NoneThe rId attribute of the c:chart great-grandchild element.
None if not present.
cx
attributecxLengthcy
attributecyLengthflipH
attributeflipHflipV
attributeflipVgraphic
attributegraphicCT_GraphicalObject= OneAndOnlyOne('a:graphic')graphicData
attributegraphicDataCT_GraphicalObjectDataa:graphicData grandchild of this graphic-frame element.
graphicData_uri
attributegraphicData_uristrstr value of uri attribute of a:graphicData grandchild.
has_oleobj
attributehas_oleobjboolTrue for graphicFrame containing an OLE object, False otherwise.
has_ph_elm
attributehas_ph_elmTrue 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 | NoneOptional 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 | NoneThe p:ph descendant element if there is one, None otherwise.
ph_idx
attributeph_idxintInteger value of placeholder idx attribute.
Raises ValueError if shape is not a placeholder.
ph_orient
attributeph_orientstrPlaceholder orientation, e.g. 'vert'.
Raises ValueError if shape is not a placeholder.
ph_sz
attributeph_szstrPlaceholder size, e.g. ST_PlaceholderSize.HALF.
Raises ValueError if shape is not a placeholder.
ph_type
attributeph_typePlaceholder type, e.g. ST_PlaceholderType.TITLE ('title').
Raises ValueError if shape is not a placeholder.
rot
attributerotfloatFloat representing degrees this shape is rotated clockwise.
shape_id
attributeshape_idInteger id of this shape
shape_name
attributeshape_nameName of this shape
spPr
attributespPrCT_ShapePropertiestxBody
attributetxBodyChild p:txBody element, None if not present.
x
attributexLengthxfrm
attributexfrmCT_Transform2D= OneAndOnlyOne('p:xfrm')xml
attributexmlstrXML string for this element, suitable for testing purposes.
Pretty printed for readability and without an XML declaration at the top.
y
attributeyLengthFunctions
first_child_found_in
funcfirst_child_found_in(*tagnames: str) -> _Element | NoneFirst child with tag in tagnames, or None if not found.
paramtagnamesstr= ()Returns
lxml.etree._Element | Noneget_or_add_xfrm
funcget_or_add_xfrm() -> CT_Transform2DReturn the required p:xfrm child element.
Overrides version on BaseShapeElement.
Returns
pptx.oxml.shapes.shared.CT_Transform2Dinsert_element_before
funcinsert_element_before(elm: ElementBase, *tagnames: str)paramelmElementBaseparamtagnamesstr= ()new_chart_graphicFrame
funcnew_chart_graphicFrame(id_: int, name: str, rId: str, x: int, y: int, cx: int, cy: int) -> CT_GraphicalObjectFrameReturn a p:graphicFrame element tree populated with a chart element.
paramid_intparamnamestrparamrIdstrparamxintparamyintparamcxintparamcyintReturns
pptx.oxml.shapes.graphfrm.CT_GraphicalObjectFramenew_graphicFrame
funcnew_graphicFrame(id_: int, name: str, x: int, y: int, cx: int, cy: int) -> CT_GraphicalObjectFrameReturn 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_intparamnamestrparamxintparamyintparamcxintparamcyintReturns
pptx.oxml.shapes.graphfrm.CT_GraphicalObjectFramenew_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_GraphicalObjectFrameReturn 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_intparamnamestrparamole_object_rIdstrparamprogIdstrparamicon_rIdstrparamxintparamyintparamcxintparamcyintparamimgWintparamimgHintReturns
pptx.oxml.shapes.graphfrm.CT_GraphicalObjectFramenew_table_graphicFrame
funcnew_table_graphicFrame(id_: int, name: str, rows: int, cols: int, x: int, y: int, cx: int, cy: int) -> CT_GraphicalObjectFrameReturn a p:graphicFrame element tree populated with a table element.
paramid_intparamnamestrparamrowsintparamcolsintparamxintparamyintparamcxintparamcyintReturns
pptx.oxml.shapes.graphfrm.CT_GraphicalObjectFrameremove_all
funcremove_all(*tagnames: str) -> NoneRemove child elements with tagname (e.g. "a:p") in tagnames.
paramtagnamesstr= ()Returns
Nonexpath
funcxpath(xpath_str: str) -> AnyOverride of lxml _Element.xpath() method.
Provides standard Open XML namespace mapping (nsmap) in centralized location.
paramxpath_strstrReturns
typing.Any