def new(cls, pic_id, image_filename): nvPicPr = OxmlElement('pic:nvPicPr') nvPicPr.append(CT_NonVisualDrawingProps.new( 'pic:cNvPr', pic_id, image_filename )) nvPicPr.append(CT_NonVisualPictureProperties.new()) return nvPicPr
def add_drawing(self, inline_or_anchor): """ Return a newly appended ``CT_Drawing`` (``<w:drawing>``) child element having *inline_or_anchor* as its child. """ drawing = OxmlElement('w:drawing') self.append(drawing) drawing.append(inline_or_anchor) return drawing
def new(cls): """ Return a new ``<w:tc>`` element, containing an empty paragraph as the required EG_BlockLevelElt. """ tc = OxmlElement('w:tc') p = CT_P.new() tc.append(p) return tc
def new(cls): """ Return a new ``<w:tc>`` element, containing an empty paragraph as the required EG_BlockLevelElt. """ tc = OxmlElement('w:tc') p = CT_P.new() tc.append(p) return tc
def add_drawing(self, inline_or_anchor): """ Return a newly appended ``CT_Drawing`` (``<w:drawing>``) child element having *inline_or_anchor* as its child. """ drawing = OxmlElement('w:drawing') self.append(drawing) drawing.append(inline_or_anchor) return drawing
def new(cls, num_id, abstractNum_id): """ Return a new ``<w:num>`` element having numId of *num_id* and having a ``<w:abstractNumId>`` child with val attribute set to *abstractNum_id*. """ abstractNumId = CT_DecimalNumber.new('w:abstractNumId', abstractNum_id) num = OxmlElement('w:num', {qn('w:numId'): str(num_id)}) num.append(abstractNumId) return num
def new(cls): """ Return a new ``<w:tbl>`` element, containing the required ``<w:tblPr>`` and ``<w:tblGrid>`` child elements. """ tbl = OxmlElement('w:tbl') tblPr = CT_TblPr.new() tbl.append(tblPr) tblGrid = CT_TblGrid.new() tbl.append(tblGrid) return tbl
def new(cls, pic_id, filename, rId, cx, cy): """ Return a new ``<pic:pic>`` element populated with the minimal contents required to define a viable picture element, based on the values passed as parameters. """ pic = OxmlElement('pic:pic', nsmap=nspfxmap('pic', 'r')) pic.append(CT_PictureNonVisual.new(pic_id, filename)) pic.append(CT_BlipFillProperties.new(rId)) pic.append(CT_ShapeProperties.new(cx, cy)) return pic
def new(cls, pic_id, filename, rId, cx, cy): """ Return a new ``<pic:pic>`` element populated with the minimal contents required to define a viable picture element, based on the values passed as parameters. """ pic = OxmlElement('pic:pic', nsmap=nspfxmap('pic', 'r')) pic.append(CT_PictureNonVisual.new(pic_id, filename)) pic.append(CT_BlipFillProperties.new(rId)) pic.append(CT_ShapeProperties.new(cx, cy)) return pic
def new(cls): """ Return a new ``<w:tbl>`` element, containing the required ``<w:tblPr>`` and ``<w:tblGrid>`` child elements. """ tbl = OxmlElement('w:tbl') tblPr = CT_TblPr.new() tbl.append(tblPr) tblGrid = CT_TblGrid.new() tbl.append(tblGrid) return tbl
def new(cls, num_id, abstractNum_id): """ Return a new ``<w:num>`` element having numId of *num_id* and having a ``<w:abstractNumId>`` child with val attribute set to *abstractNum_id*. """ abstractNumId = CT_DecimalNumber.new( 'w:abstractNumId', abstractNum_id ) num = OxmlElement('w:num', {qn('w:numId'): str(num_id)}) num.append(abstractNumId) return num
def new(cls, cx, cy, shape_id, pic): """ Return a new ``<wp:inline>`` element populated with the values passed as parameters. """ name = 'Picture %d' % shape_id uri = nsmap['pic'] inline = OxmlElement('wp:inline', nsmap=nspfxmap('wp', 'r')) inline.append(CT_PositiveSize2D.new('wp:extent', cx, cy)) inline.append(CT_NonVisualDrawingProps.new('wp:docPr', shape_id, name)) inline.append(CT_GraphicalObject.new(uri, pic)) return inline
def new(cls, cx, cy, shape_id, pic): """ Return a new ``<wp:inline>`` element populated with the values passed as parameters. """ name = 'Picture %d' % shape_id uri = nsmap['pic'] inline = OxmlElement('wp:inline', nsmap=nspfxmap('wp', 'r')) inline.append(CT_PositiveSize2D.new('wp:extent', cx, cy)) inline.append(CT_NonVisualDrawingProps.new( 'wp:docPr', shape_id, name )) inline.append(CT_GraphicalObject.new(uri, pic)) return inline
def new(cls, rId): blipFill = OxmlElement('pic:blipFill') blipFill.append(CT_Blip.new(rId)) blipFill.append(CT_StretchInfoProperties.new()) return blipFill
def new(cls, cx, cy): spPr = OxmlElement('a:xfrm') spPr.append(CT_Point2D.new('a:off', 0, 0)) spPr.append(CT_PositiveSize2D.new('a:ext', cx, cy)) return spPr
def new(cls): stretch = OxmlElement('a:stretch') stretch.append(CT_RelativeRect.new()) return stretch
def new(cls, cx, cy): spPr = OxmlElement('pic:spPr') spPr.append(CT_Transform2D.new(cx, cy)) spPr.append(CT_PresetGeometry2D.new('rect')) return spPr
def new(cls, uri, pic): graphic = OxmlElement('a:graphic') graphic.append(CT_GraphicalObjectData.new(uri, pic)) return graphic
def new(cls, cx, cy): spPr = OxmlElement('pic:spPr') spPr.append(CT_Transform2D.new(cx, cy)) spPr.append(CT_PresetGeometry2D.new('rect')) return spPr
def new(cls, cx, cy): spPr = OxmlElement('a:xfrm') spPr.append(CT_Point2D.new('a:off', 0, 0)) spPr.append(CT_PositiveSize2D.new('a:ext', cx, cy)) return spPr
def new(cls, uri, pic): graphicData = OxmlElement('a:graphicData') graphicData.set('uri', uri) graphicData.append(pic) return graphicData
def new(cls, uri, pic): graphic = OxmlElement('a:graphic') graphic.append(CT_GraphicalObjectData.new(uri, pic)) return graphic
def new(cls, uri, pic): graphicData = OxmlElement('a:graphicData') graphicData.set('uri', uri) graphicData.append(pic) return graphicData
def new(cls): stretch = OxmlElement('a:stretch') stretch.append(CT_RelativeRect.new()) return stretch
def new(cls, pic_id, image_filename): nvPicPr = OxmlElement('pic:nvPicPr') nvPicPr.append( CT_NonVisualDrawingProps.new('pic:cNvPr', pic_id, image_filename)) nvPicPr.append(CT_NonVisualPictureProperties.new()) return nvPicPr
def new(cls, rId): blipFill = OxmlElement('pic:blipFill') blipFill.append(CT_Blip.new(rId)) blipFill.append(CT_StretchInfoProperties.new()) return blipFill