0

I have added aria-hidden="true" for span tag and converted it to PDF. Now I am trying to read the content inenter code here PDF using text to speech voice reader extension in google chrome.

<body>
    <span>
        This content is perceivable by screen readers.
    </span>
    <span aria-hidden="true">
        This content is not perceivable by screen readers.
    </span>
</body>
GrahamTheDev
  • 22,724
  • 2
  • 32
  • 64
  • Care to explain a bit better, what are you using to convert to a PDF, what exactly are you expecting as at the moment there is just some HTML and no explanation of what you are wanting to happen. It looks like you meant to include something with the bit that reads "contentin**enter code here** PDF but made a mistake. You can click the grey "edit" text below your question (next to "share") to fix your question. – GrahamTheDev Jul 13 '20 at 11:05
  • @GrahamRitchie I am using online pdf converter to convert this HTML to PDF. – Sanjith Kesavan Jul 13 '20 at 11:09
  • and what text are you now trying to read? i.e. is it reading all the content and ignoring the `aria-hidden`? is it not reading anything? We need to know what the issue is as at the moment you haven't actually said it! hehe – GrahamTheDev Jul 13 '20 at 11:24
  • @GrahamRitchie I want to hide the text in span tag while trying to read it using text to speech voice reader extension in google chrome. – Sanjith Kesavan Jul 13 '20 at 11:47
  • There is no guarantee what any particular HTML to PDF converter will do with an `aria-hidden` tag. I think you need to be clearer about exactly what you are hoping to achieve, and whether you're trying to achieve it in HTML, or whether it needs to be in PDF. – karora Jul 13 '20 at 12:49
  • Ahhhh I think you are looking for "visually hidden text", that is text that cannot be seen but can be read by a screen reader. Try this https://stackoverflow.com/a/62109988/2702894. `aria-hidden` is the opposite of what you want, you use `aria-hidden` to hide something in a screen reader. – GrahamTheDev Jul 13 '20 at 16:02

0 Answers0