Alt for images in JasperReports

When inserting an image element into a PDF report, how can we give an alt description or similar description for this image? The idea is to read a description when a screen reader is used to read a PDF file. Currently, the reader (JAWS) only says “graphic” when it encounters an image in PDF.

Thank!

+3
source share
1 answer
Finally it turned out. In case someone has a similar request; You can use hyperlinkTooltipExpressionto set alternative text. Something like that;
<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>
+1
source

Source: https://habr.com/ru/post/1737499/


All Articles