问题
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