Tutorial by Examples

private string AddGraph(WordprocessingDocument wpd, string filepath) { ImagePart ip = wpd.MainDocumentPart.AddImagePart(ImagePartType.Jpeg); using (FileStream fs = new FileStream(filepath, FileMode.Open)) { if (fs.Length == 0) return string.Empty; ip.FeedData(fs); ...
private void InsertImage(WordprocessingDocument wpd, OpenXmlElement parent, string filepath) { string relationId = AddGraph(wpd, filepath); if (!string.IsNullOrEmpty(relationId)) { Size size = new Size(800, 600); Int64Value width = size.Width * 9525; Int6...

Page 1 of 1