Alt for images in JasperReports

image, jasper-reports

Solution

Found out at last. In case anyone is having similar query; You could use the `hyperlinkTooltipExpression`to set the alternate text. Something like this;

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

Problem

While putting an image element in PDF report, how can we give the alt description or similar kind of description for that image? The idea is to read the description when some screen reader is used to read the PDF. Currently, the reader (JAWS) says just 'graphic' when encountering an image in the PDF. Thanks!

Original source