mirror of
https://github.com/fumiama/go-docx.git
synced 2026-06-08 01:00:25 +08:00
inline drawing add Size
This commit is contained in:
@@ -95,3 +95,15 @@ func (p *Paragraph) AddInlineDrawingFrom(file string) (*Run, error) {
|
||||
}
|
||||
return p.AddInlineDrawing(data)
|
||||
}
|
||||
|
||||
// Size of the inline drawing by EMU
|
||||
func (in *WPInline) Size(w, h int) {
|
||||
if in.Extent != nil {
|
||||
in.Extent.CX = w
|
||||
in.Extent.CY = h
|
||||
}
|
||||
if in.Graphic != nil && in.Graphic.GraphicData != nil && in.Graphic.GraphicData.Pic != nil && in.Graphic.GraphicData.Pic.SpPr != nil {
|
||||
in.Graphic.GraphicData.Pic.SpPr.Xfrm.Ext.CX = w
|
||||
in.Graphic.GraphicData.Pic.SpPr.Xfrm.Ext.CY = h
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user