/// <summary> /// 写表格下面图片 /// </summary> /// <param name="builder"></param> /// <param name="path"></param> public static void WriteImage(Aspose.Words.DocumentBuilder builder, string path, double width, double height) { string image = path; if (File.Exists(path)) { builder.AAInsertImage(image, width, height, 0, 0); builder.InsertBreak(BreakType.ParagraphBreak); } }
/// <summary> /// 写表格下面图片 /// </summary> /// <param name="builder"></param> /// <param name="path"></param> public static void WriteImage(Aspose.Words.DocumentBuilder builder, string path) { string image = path; if (!string.IsNullOrEmpty(path) && File.Exists(path)) { builder.ParagraphFormat.StyleIdentifier = Aspose.Words.StyleIdentifier.BodyText; builder.ParagraphFormat.Alignment = ParagraphAlignment.Center; var w = ConfigurationManager.AppSettings["chartWidth1"].ToInt(); var h = ConfigurationManager.AppSettings["chartHeight1"].ToInt(); builder.AAInsertImage(image, w, h, 0, 0); builder.InsertBreak(BreakType.ParagraphBreak); } }