如何使图像成为“热点"使用 fo:basic-link [英] How to make an image a "hotspot" using fo:basic-link

查看:24
本文介绍了如何使图像成为“热点"使用 fo:basic-link的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用下面的代码在基本链接下包装图像

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>

现在,在生成的 pdf 中,只有图像的最底部边缘有超链接(仅当光标移动到图像底部时才会出现).

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.

推荐答案

text-altitude 属性可用于使整个图像成为活动链接.将值设置为图像的高度:

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>

注意:我已验证这适用于 XEP FO 处理器.它不适用于 FOP(text-altitude不支持).

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

这篇关于如何使图像成为“热点"使用 fo:basic-link的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆