I am working on an application which has similar requirements as posted on
In my Word template, I have a few bookmarks. For each bookmark, I will need to insert an image at runtime based on my business logic.
I am using InsertHtml method to add the image tag at the bookmarks. In my image tag, I set the atl=“imgId”. However, the alt is set to empty in the html output.
DocumentBuilder docBuilder = new DocumentBuilder(AsposeDocument);
docBuilder.MoveToBookmark("HeaderImg");
//docBuilder.InsertImage(imgUrl);
docBuilder.InsertHtml(string.Format("<img id=\"headerImg\" src='{0}' alt='ImgId'/>", imgUrl));
Aspose Word generated the image tag as a <img src="http://company/Library/header.jpg" width="650" height="250" alt="" />
I can use ImageSavingCallback as suggested. However, how do I set absolute path img src for multiple images in the same document? The ImageSavingArgs does not have any property which can be used to identify the image ids. In my other test, I added a static image in the Word template and set the AltText. The CurrentShape.AlternativeText is still empty.
I am using the Aspose Word 13.3, evaluate version.
Thanks for your help!