We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Insert image at bookmark

Hi everyone! I’m looking for the best way to insert an image to a specific bookmark. I found this topic which is not up-to-date regarding the code : Replace the bookmark and its text with image using Java


Here is my code which doesn’t work. I mean it doesn’t insert the image…

string File = Application.dataPath + jsonModel.EDFRapports.rapport_travaux [phasesContentStatus.IDCurrentPhase].rapport_file;

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

//Image insert
Bookmark bm_photos = doc.Range.Bookmarks ["photos"];

builder.MoveToBookmark ("photos");

builder.InsertImage (photoPath);
doc.Save(File);

Hi there,


Thanks for your inquriy. I have tested your shared code with a sample Word Document and successfully inserted the image at existing bookmark using Aspose.Words for .NET 17.5. We will appreciate it if you please share your sample input, output and expected documents here. W will look into it and will guide you accordingly.

Best Regards,