Perhaps certain PDF viewers don’t fully support the entire PDF standard, but if you open the output PDF with Acrobat Reader or even the latest Chrome browser, hyperlinks should work. This includes hyperlinks around images. Our code only looks at the wrapped content to determine its bounding box.
I did a quick test with an anchor targeting
http://www.google.com around an image and it worked for me in both Acrobat and Chrome.
The PDF viewer doesn’t scan the text in the PDF to recognize portions that look like hyperlinks. A hyperlink in a PDF consists of an annotation with an area and a click target. If that annotation is not present the text is not considered a hyperlink even if it starts with
http://. Our code iterates over all anchor tags and adds those annotations.
Things get more complicated when dealing with local links, i.e. links to elements on other pages and potentially even in other sections. But I assume we are talking about an external link here.