Пример #1
0
 public static void AddImageToBody(this WordprocessingDocument wordDoc, BitmapSource image)
 {
     var drawing = wordDoc.GetDrawingFromImage(image);
     wordDoc.MainDocumentPart.Document.Body.AppendChild(new Paragraph(new Run(drawing)));
 }
Пример #2
0
 public static OpenXmlElement InsertImageAfter(this WordprocessingDocument wordDoc, OpenXmlElement appendAfter, BitmapSource image)
 {
     var drawing = wordDoc.GetDrawingFromImage(image);
     return wordDoc.MainDocumentPart.Document.Body.InsertAfter(new Paragraph(new Run(drawing)), appendAfter);
 }