使用 Enterprise Architect 加载项 我想使用 c# 将图像从 Enterprise Architect 导入到 ms Word。现在,我已经通过将图表/图像保存为 .pdf 文件,然后使用 iTextSharp 再次阅读来解决了这个问题。 在我看来,这是解决问题的困难方法,因此我认为必须有一种更简单的方法来使用 c# 将图像从 Enterprise Architect 获取到 ms Word。
最佳答案
为什么不直接将图像插入文档中?
//create a document generator
EA.DocumentGenerator generator;
//initialize the document generator to create empty document (with no EA template)
generator = Repository.CreateDocumentGenerator();
generator.NewDocument("");
//insert image to the document
generator.DocumentDiagram(diagram.DiagramID, 0, "Diagram Image Template");
//save the documrnt
generator.SaveDocument(@"path/of/word/document/with/extension", 0);
“图表图像模板”
是您必须通过以下简单步骤在 EA 中自行定义的模板:
1.点击F8
2.进入模板选项卡
3.点击底部的新建
按钮
4.将新模板命名为“图表图像模板”
,然后单击“确定”。将打开新模板的文档。
5.在文档的左侧面板上,选中图表
复选框。一些文本将添加到右侧的文档中。
6.在模板文档中,右键单击您看到文本[right-click-to-insert-Diagram-field(s)]
-> 插入字段 -> 图表图像的位置。
7.保存模板。
关于c# - 将图像从 Enterprise Architect 导入到 MS Word,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25358337/