代码之家  ›  专栏  ›  技术社区  ›  vpram86

JasperReports中图像的Alt

  •  3
  • vpram86  · 技术社区  · 16 年前

    在PDF报告中放置图像元素时,如何为该图像提供alt描述或类似的描述?这样做的目的是在使用屏幕阅读器读取PDF时读取描述。目前,阅读器(JAWS)在遇到PDF中的图像时只会说“graphic”。

    谢谢

    1 回复  |  直到 16 年前
        1
  •  3
  •   vpram86    16 年前

    终于发现了。 hyperlinkTooltipExpression 设置备用文本。像这样的东西;

    <image isLazy="true">
        <reportElement positionType="Float" x="0" y="0" width="100" height="100"/>
        <imageExpression class="java.lang.String"><![CDATA[$P{imageToBeShown}]]></imageExpression>
        <hyperlinkTooltipExpression><![CDATA["Description goes here"]]></hyperlinkTooltipExpression>
    </image>
    
    推荐文章