c# - Import image from Enterprise Architect to ms Word -
working on enterprise architect add-in want import image enterprise architect ms word using c#. have solved saving diagram/image .pdf file , reading again using itextsharp. seems me hard way around problem , therefore think there must more simple way image enterprise architect ms word using c#.
why don't insert image straight document?
//create document generator ea.documentgenerator generator; //initialize document generator create empty document (with no ea template) generator = repository.createdocumentgenerator(); generator.newdocument(""); //insert image document generator.documentdiagram(diagram.diagramid, 0, "diagram image template"); //save documrnt generator.savedocument(@"path/of/word/document/with/extension", 0);
the "diagram image template"
template have define in ea following these easy steps:
1. click f8
2.go templates tab
3.click on new
button on bottom
4.give new template name "diagram image template"
, , click ok. document of new template opened.
5.on left panel of document, select diagram
checkbox. text added document on right.
6.in template document, right click see text [right-click-to-insert-diagram-field(s)]
-> insert field -> diagram image.
7.save template.
Comments
Post a Comment