How to make an image a “hotspot” using fo:basic-link

浪尽此生 提交于 2019-12-23 22:30:46

问题


I am using below code for wrapping image under basic-link

<xsl:template name="bottomSection">
  <fo:block>
     <fo:basic-link color="blue" external-destination="http://www.google.com">
       <fo:external-graphic src="url('E:/images/promoAdd.jpg')"/>
     </fo:basic-link>
  </fo:block> 
</xsl:template>

Now, in the resulting pdf, only the very bottom edge of the image has hyperlink (it appears only when cursor is moved at the bottom of the image).

I need to display this hyperlink when cursor is moved to any part of the image.

Please let me know if I can use some other approach.


回答1:


The text-altitude property can be used to make the whole image an active link. Set the value to the height of the image:

<fo:basic-link color="blue" external-destination="url('http://www.google.com')"
               text-altitude="75px">
  <fo:external-graphic src="url('E:/images/promoAdd.jpg')"/>
</fo:basic-link>

Note: I have verified that this works with the XEP FO processor. It does not work with FOP (text-altitude is not supported).



来源:https://stackoverflow.com/questions/8532265/how-to-make-an-image-a-hotspot-using-fobasic-link

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!