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

Free Support Forum - aspose.com

Is it possible to add a hyperlink or bookmark to an image

I know that using document builder I can navigate to a node before the image and add a hyperlink.
But what I want is to add a hyperlink to an image.

Please have a look at the attached document to understand what I am saying.

Also, can a similar thing be done for bookmarks?

Thanks.

Hi,

Thanks for your inquiry. You can achieve this by using the ShapeBase.HRef property; for example, please try run the following code snippet. This code inserts a click able (Hyperlinked) image in Word document:
DocumentBuilder builder = new DocumentBuilder();
Shape shape = builder.insertImage("C:\\Temp\\Aspose.Words.png");
shape.setHRef("http://www.aspose.com/images/aspose-logo.gif");
builder.getDocument().save("C:\\Temp\\out.docx");
Secondly, the actions that can be performed with bookmarks using Aspose.Words are the same as the ones you can perform using Microsoft Word. You can insert a new bookmark, delete, move to a bookmark, get or set a bookmark name, get or set text enclosed in it.
http://www.aspose.com/docs/display/wordsjava/Bookmarks+in+Aspose.Words

Please let me know if I can be of any further assistance.

Best regards,

Thanks, this helps.