Page 1 of 1

Links in TOC have incorrect alt text in PDF generated from Apache (PDF/UA-1)

Posted: Wed Jun 29, 2022 6:40 pm
by rjcbop
We're attempting to create accessible PDF's using the default Apache engine and are using a custom fop.xconf file. In that file, we've set the following:
<accessibility>true</accessibility>

...and:
<renderer mime="application/pdf">
<pdf-ua-mode>PDF/UA-1</pdf-ua-mode>

In the generated PDF (from Oxygen 24.0), the <Link> tags associated with the table of contents entries are automatically populated with the following value for the Alternate Text property:
"No alternate text specified"

Since the TOC entries are generated from the topicrefs in our maps, we're not setting any alt text (and it doesn't appear that you even can). When a screen reader (tested with both JAWS and NVDA) reads these TOC entries, it reads this default text instead of the name of the TOC entry. If you manually remove the value of the Alternate Text property, the screen reader correctly reads the TOC entry.

Has anyone encountered this? We're wondering if there's some other setting that we can specify in the fop.xconf file that will prevent the creation of these alt text values.

Thanks for any help with this.

Re: Links in TOC have incorrect alt text in PDF generated from Apache (PDF/UA-1)

Posted: Thu Jun 30, 2022 12:23 pm
by julien_lacour
Hello,

Until now, we haven't encountered this problem, but I added an issue on our side to see if it is possible to improve the screen readers support.
Thank you for reporting the problem.

Regards,
Julien

Re: Links in TOC have incorrect alt text in PDF generated from Apache (PDF/UA-1)

Posted: Fri Jul 01, 2022 4:32 pm
by rjcbop
Thank you!

Re: Links in TOC have incorrect alt text in PDF generated from Apache (PDF/UA-1)

Posted: Wed Jul 20, 2022 6:35 pm
by rjcbop
We've found what seems to be a very simple fix for this by overriding one of the templates in toc.xsl (from the org.dita.pdf2 plugin). Specifically, in the template that matches on *[contains(@class, ' topic/topic ')], and has mode="toc", we added the following attribute to the fo:basic-link element:
<xsl:attribute name="fox:alt-text">
<xsl:call-template name="getNavTitle" />
</xsl:attribute>
You also, of course, have to add the fox namespace (xmlns:fox="http://xmlgraphics.apache.org/fop/extensions") to the root element in your local copy of toc.xsl (we have a custom plug-in for generating PDF's).
The result is that the Alternate Text property of the Link tags for the TOC (in the PDF) are now populated with the topic title, which is then read by a screen reader.

Thanks for any comments or advice you might have on this temporary fix/workaround.

Re: Links in TOC have incorrect alt text in PDF generated from Apache (PDF/UA-1)

Posted: Mon Aug 08, 2022 10:34 am
by julien_lacour
Hello,

I added https://github.com/dita-ot/dita-ot/issues/3985 on DITA-OT side, eventually this will lead to a pull request with your proposed solution.
I will updated this thread once the solution will be available.

Regards,
Julien

Re: Links in TOC have incorrect alt text in PDF generated from Apache (PDF/UA-1)

Posted: Mon Aug 08, 2022 5:54 pm
by rjcbop
Hi Julien,

Thanks very much for requesting this fix on the DITA-OT side. I should note that, since I originally discovered this issue, I've found that the same issue occurs for any instance of the <fo:basic-link> element, not just TOC entries. So, for example, the same issue occurs for <fo:basic-link> elements that are generated from a DITA <xref> element.

Regards,
Rich