locked
Inserting image with links to Word RRS feed

  • Question

  • Hi,

    I have an image that I would normally display on a web page with a map overlay tag. I need to be able to do two things:

    1. The image must be inserted into the document and not src from our website.
    2. I need clickable areas on the image.

    Of course, I can insert HTML or I can set OOXML for the image, but I run into problems. As far as I know I cannot set a link map for an OOXML image. For the HTML, I would have to point to the server to host the image. I attempted to Base64 the image and insert it, but it appears Word will not support this. I can insert the img tag as HTML into word, no problem. However, the src seems to only allow 256 characters, so I cannot insert the base64 data for my image, which is, naturally, far more than 256 characters. Anyone have any suggestions?

    Thanks,
    Keith

    Tuesday, November 20, 2012 9:54 PM

Answers

  • For Word to display the image (using coercion type HTML) , the src parameter has to be a valid url/path. Passing in base64 data in as the src parameter is not valid. I do not think IE supports this either, but other browsers may. You shouldn't be getting a 256 character limit using a valid url - please let me know if you are still seeing that.

    For this scenario insertion using coercion type OOXML may be the way to go. You could place hyperlinked transparent shapes over the image and group them all together with the image. Or you could split the image up
    into multiple images with their own individual hyperlinks, once again all grouped together so that they stay in the correct position relative to each other. You can try playing around with images, hyperlinks, shapes and grouping
    in Word to get something that works, and then inspect the OOXML representation
    of that. This sounds like a more complex route but it might get you the behavior you need. Hope that helps...

    Gareth

    • Edited by Gareth Pinto Wednesday, November 28, 2012 7:10 PM
    • Marked as answer by Quist Zhang Monday, December 10, 2012 6:41 AM
    Wednesday, November 28, 2012 4:34 PM

All replies

  • Hi Keith,

    Unfortunately there is no real way to achieve an image with multiple target links in Word. That is the type of scenario most suited for a content app. You can definitely insert a hyperlinked image (single hyperlink). Keep in mind that a customer would need to ctrl + click the image. Alternatively, you can insert the image and also include hyperlinks as text below - would that be sufficient for your scenario?

    Gareth

    Wednesday, November 21, 2012 11:07 PM
  • Thanks for the reply. This wouldn't work for us, our images are like maps, they may contain different links on different areas of the image. Is the 256 character limit for src on an image tag by design or is this a bug which may be corrected later? If we could insert an image tag with the image base64'd as the source, this would solve the problem. It seems odd as I have to insert the same base64 data to insert the image as ooxml.

    Again, thanks for your reply,

    Keith

    Monday, November 26, 2012 7:19 PM
  • For Word to display the image (using coercion type HTML) , the src parameter has to be a valid url/path. Passing in base64 data in as the src parameter is not valid. I do not think IE supports this either, but other browsers may. You shouldn't be getting a 256 character limit using a valid url - please let me know if you are still seeing that.

    For this scenario insertion using coercion type OOXML may be the way to go. You could place hyperlinked transparent shapes over the image and group them all together with the image. Or you could split the image up
    into multiple images with their own individual hyperlinks, once again all grouped together so that they stay in the correct position relative to each other. You can try playing around with images, hyperlinks, shapes and grouping
    in Word to get something that works, and then inspect the OOXML representation
    of that. This sounds like a more complex route but it might get you the behavior you need. Hope that helps...

    Gareth

    • Edited by Gareth Pinto Wednesday, November 28, 2012 7:10 PM
    • Marked as answer by Quist Zhang Monday, December 10, 2012 6:41 AM
    Wednesday, November 28, 2012 4:34 PM