E-mail List Archives
Thread: Can you remove link underlines and focus indicators in PDF documents?
Number of posts in this thread: 8 (In chronological order)
From: Birkir R. Gunnarsson
Date: Thu, Feb 13 2025 10:00AM
Subject: Can you remove link underlines and focus indicators in PDF documents?
No previous message | Next message →
Hey y'all
Probably a couple of silly questions, but I want to make sure.
I'm trying to translate an easy manual accessibility checklist from web to
PDF.
One requirement is to make sure all interactive elements have a focus
indicator. You can easily remove that in a browser but I don't know if it
needs to be tested in a PDF document (can the document authors somehow
remove the focus outline?)
The other check is to make sure that links in a block of text are
underlined. Again, can the author of a PDF document do things like removing
default underlines from links or bookmarks?
Thanks for any insights you might have. I don't want to remove easy checks
but I also don't want to waste people's time on something that is a near
impossibility to happen.
Cheers
-Birkir
--
Work hard. Have fun. Make history.
From: Philip Kiff
Date: Thu, Feb 13 2025 11:40AM
Subject: Re: Can you remove link underlines and focus indicators in PDF documents?
← Previous message | Next message →
Hi Birkir,
On 2025-02-13 12:00 p.m., Birkir R. Gunnarsson via WebAIM-Forum wrote:
> One requirement is to make sure all interactive elements have a focus
> indicator. You can easily remove that in a browser but I don't know if it
> needs to be tested in a PDF document (can the document authors somehow
> remove the focus outline?)
No, for most "static" PDFs, I don't think you need to test for this. The
"focus" indicator is not normally something that is written into the
PDF, but rather something that is applied by whatever software you use
to read the PDF. Some PDF readers allow users to customize how they want
links or input fields to appear during interactions.
If you are creating "dynamic" fillable PDFs that use XFA (XML Forms
Architecture), then I think you would need to test all the interactions,
including focus indicators. That format gives you a lot of control over
the user interface. But creating accessible "dynamic" XML forms is
highly specialized work, and creating accessible forms is always a
challenge, and not something that can be fixed or tested with basic checks.
On 2025-02-13 12:00 p.m., Birkir R. Gunnarsson via WebAIM-Forum wrote:
> The other check is to make sure that links in a block of text are
> underlined. Again, can the author of a PDF document do things like removing
> default underlines from links or bookmarks?
Definitely you should check that links are underlined or otherwise
indicated clearly. Most PDF software allows creators to remove such
marks - there is an actual setting called "invisible" that you can apply
to a link annotation in a PDF. When applied, the only way that some
users can discover the links is when they happen to hover their mouse
above the relevant piece of text. I would follow current WCAG best
practices when interpreting whether links require underlines in a PDF or
if some other visually distinct indicator is acceptable. Underlining and
colouring in blue is the most widely recognized method for standard PDF
text documents.
Phil.
Philip Kiff
D4K Communications
From: Philip Kiff
Date: Thu, Feb 13 2025 12:13PM
Subject: Re: Can you remove link underlines and focus indicators in PDF documents?
← Previous message | Next message →
On 2025-02-13 1:40 p.m., Philip Kiff via WebAIM-Forum wrote:
> On 2025-02-13 12:00 p.m., Birkir R. Gunnarsson via WebAIM-Forum wrote:
>
>> The other check is to make sure that links in a block of text are
>> underlined. Again, can the author of a PDF document do things like
>> removing
>> default underlines from links or bookmarks?
>
> Definitely you should check that links are underlined or otherwise
> indicated clearly. Most PDF software allows creators to remove such
> marks - there is an actual setting called "invisible" that you can
> apply to a link annotation in a PDF. When applied, the only way that
> some users can discover the links is when they happen to hover their
> mouse above the relevant piece of text. I would follow current WCAG
> best practices when interpreting whether links require underlines in a
> PDF or if some other visually distinct indicator is acceptable.
> Underlining and colouring in blue is the most widely recognized method
> for standard PDF text documents.
Mmmm... I guess I should add that there are some cases when I think it
is actually acceptable NOT to underline links in a PDF. In a Table of
Contents, for example, where every item in the Table of Contents is a
link to a corresponding heading, then I don't think you need to
underline every entry. In fact, underlining every entry might make it
harder for some folks to read - you would get a page of all underlined
text.
Admittedly, that means that some users won't actually know that the
items in the Table of Contents are links unless they try to click on
one. Though I think that every Table of Contents *should* be a set of
links, so I wouldn't publish a PDF that didn't link each heading. But
that still leaves folks opening up PDFs and randomly trying to click on
headings in the Table of Contents without knowing in advance whether
clicking on it will work. Sometimes it's better to use the bookmarks
panel instead - which should normally duplicate the links in the Table
of Contents.
While WCAG doesn't really apply cleanly to PDFs, I think that a Table of
Contents can roughly fall under the same Success Criteria as those
covering navigation or menu links on a web page, which aren't normally
required to be underlined provided that it is clear that they are part
of a navigation menu.
Phil.
From: Steve Green
Date: Fri, Feb 14 2025 1:14AM
Subject: Re: Can you remove link underlines and focus indicators in PDF documents?
← Previous message | Next message →
Adobe Reader automatically sets the colour of the focus indicator based on the link's background colour. This could have worked really well, but they created an incredibly stupid algorithm for doing it. The result is that in terms of WCAG conformance, the focus indicator has sufficient colour contrast against some background colours but not against others. Fortunately, you can choose background colours that you know will have sufficient contrast.
The algorithm is very simple. They simple deduct the hex colour of the background from #FFFFFF to get the focus indicator colour. If the background is #E26B0A (which is a dark orange), the focus indicator will be #1D94F5, which gives a colour contrast ratio of 1.04 so the focus indicator is virtually invisible. But if the background is #FFCC99 (which is a light orange), the focus indicator is #003366, giving a contrast ratio of 8.62.
I have attached a test file containing a variety of background colours that I used to verify the algorithm works the way I described above.
It's worth noting that Adobe Reader calculates the focus indicator colour for individual dots in its dotted outline. The result is that some parts of the focus indicator colour will be different from other parts if the link overlays an irregular background colour such as a gradient or an image. In marginal situations, this increases the chance of at least some of focus indicator having sufficient contrast.
Of course, other PDF readers will apply different focus indicator colours. In the Edge browser, the focus indicator colour varies between pure black and almost pure black depending on the background colour, so it is non-conformant against many background colours and is even worse than Adobe Reader.
Chrome uses its dual colour black and white focus indicator, so it has sufficient colour contrast against all background colours. Likewise, Firefox uses its dual colour blue and white focus indicator.
Steve Green
Managing Director
Test Partners Ltd
From: Ryan E. Benson
Date: Sun, Feb 16 2025 2:39PM
Subject: Re: Can you remove link underlines and focus indicators in PDF documents?
← Previous message | Next message →
Hi Birkir,
My first question is who is the target audience?
I am going to slightly disagree with Phil. The look of the focus is handled
by the viewer itself, though I guess somebody could write JS to change it,
if they so desired, but more importantly a "Link - OBJR" element is
required to make the link focusable. I believe that most tools
automatically create this these days, but I can't say all. Depending on the
audience, having them tab through a PDF may be something to consider.
--
Ryan E. Benson
On Thu, Feb 13, 2025 at 1:40 PM Philip Kiff via WebAIM-Forum <
= EMAIL ADDRESS REMOVED = > wrote:
> Hi Birkir,
>
> On 2025-02-13 12:00 p.m., Birkir R. Gunnarsson via WebAIM-Forum wrote:
> > One requirement is to make sure all interactive elements have a focus
> > indicator. You can easily remove that in a browser but I don't know if it
> > needs to be tested in a PDF document (can the document authors somehow
> > remove the focus outline?)
>
> No, for most "static" PDFs, I don't think you need to test for this. The
> "focus" indicator is not normally something that is written into the
> PDF, but rather something that is applied by whatever software you use
> to read the PDF. Some PDF readers allow users to customize how they want
> links or input fields to appear during interactions.
>
> If you are creating "dynamic" fillable PDFs that use XFA (XML Forms
> Architecture), then I think you would need to test all the interactions,
> including focus indicators. That format gives you a lot of control over
> the user interface. But creating accessible "dynamic" XML forms is
> highly specialized work, and creating accessible forms is always a
> challenge, and not something that can be fixed or tested with basic checks.
>
> On 2025-02-13 12:00 p.m., Birkir R. Gunnarsson via WebAIM-Forum wrote:
>
> > The other check is to make sure that links in a block of text are
> > underlined. Again, can the author of a PDF document do things like
> removing
> > default underlines from links or bookmarks?
>
> Definitely you should check that links are underlined or otherwise
> indicated clearly. Most PDF software allows creators to remove such
> marks - there is an actual setting called "invisible" that you can apply
> to a link annotation in a PDF. When applied, the only way that some
> users can discover the links is when they happen to hover their mouse
> above the relevant piece of text. I would follow current WCAG best
> practices when interpreting whether links require underlines in a PDF or
> if some other visually distinct indicator is acceptable. Underlining and
> colouring in blue is the most widely recognized method for standard PDF
> text documents.
>
> Phil.
>
> Philip Kiff
> D4K Communications
>
>
From: Philip Kiff
Date: Tue, Feb 18 2025 9:09AM
Subject: Re: Can you remove link underlines and focus indicators in PDF documents?
← Previous message | Next message →
That is super interesting to me, Steve!
Thanks so much for taking the time to figure out how the algorithm in
Adobe Reader works, explaining it to the list, and for sharing the test
file (which I received off-list because you cc'd me - the mailing list
otherwise strips out attachments, I think).
I guess I've never actually carefully thought about - or even carefully
observed (!) - the differences in how focus colour and background colour
interact with link colour in different PDF software readers.
In the sample links in the PDF you sent, I notice that most (or all?)
cases of colour contrast failures for focus indicator vs background, the
link text itself would also fail to meet colour contrast minimums for
standard foreground vs background text. So perhaps - at least with Adobe
Reader - the current algorithm should lead to a focus indicator that
meets minimum colour contrast guidelines, provided that your link text
itself also does?
Also, while checking the PDF viewers in Firefox and Chrome just now, I
don't see the "dual colour" black and white focus indicator in Chrome? I
do see a dual colour indicator in Firefox, with black then white
outlines, which as you say, will force the focus to become visible
regardless of background. When I tried to test in Chrome, all I seem to
be getting is a dotted black focus indicator, which remains the same
colour regardless of background colour. And which is therefore entirely
invisible against a black background. Though maybe my browser/system
dark mode/accessibility settings are affecting Chrome's display. I'm
testing with Windows 11, Chrome 133.0.6943.99 64-bit.
Like I say, this is all new learning for me, and very interesting, thanks.
Phil.
On 2025-02-14 3:14 a.m., Steve Green via WebAIM-Forum wrote:
> Adobe Reader automatically sets the colour of the focus indicator based on the link's background colour. This could have worked really well, but they created an incredibly stupid algorithm for doing it. The result is that in terms of WCAG conformance, the focus indicator has sufficient colour contrast against some background colours but not against others. Fortunately, you can choose background colours that you know will have sufficient contrast.
>
> The algorithm is very simple. They simple deduct the hex colour of the background from #FFFFFF to get the focus indicator colour. If the background is #E26B0A (which is a dark orange), the focus indicator will be #1D94F5, which gives a colour contrast ratio of 1.04 so the focus indicator is virtually invisible. But if the background is #FFCC99 (which is a light orange), the focus indicator is #003366, giving a contrast ratio of 8.62.
>
> I have attached a test file containing a variety of background colours that I used to verify the algorithm works the way I described above.
>
> It's worth noting that Adobe Reader calculates the focus indicator colour for individual dots in its dotted outline. The result is that some parts of the focus indicator colour will be different from other parts if the link overlays an irregular background colour such as a gradient or an image. In marginal situations, this increases the chance of at least some of focus indicator having sufficient contrast.
>
> Of course, other PDF readers will apply different focus indicator colours. In the Edge browser, the focus indicator colour varies between pure black and almost pure black depending on the background colour, so it is non-conformant against many background colours and is even worse than Adobe Reader.
>
> Chrome uses its dual colour black and white focus indicator, so it has sufficient colour contrast against all background colours. Likewise, Firefox uses its dual colour blue and white focus indicator.
>
> Steve Green
> Managing Director
> Test Partners Ltd
>
>
From: Philip Kiff
Date: Tue, Feb 18 2025 9:24AM
Subject: Re: Can you remove link underlines and focus indicators in PDF documents?
← Previous message | Next message →
That's a helpful corrective/clarification, Ryan, thanks.
When testing a PDF for accessibility, one of the manual checks that I do
is to tab through links and form controls to make sure they work and
that the order makes sense. I haven't really paid any attention to focus
indicator colours when I do this. Maybe I should start to pay at least a
bit of attention to those as well, if I'm going to be tabbing through
the links anyways.
Phil.
On 2025-02-16 4:39 p.m., Ryan E. Benson via WebAIM-Forum wrote:
> Hi Birkir,
>
> My first question is who is the target audience?
>
> I am going to slightly disagree with Phil. The look of the focus is handled
> by the viewer itself, though I guess somebody could write JS to change it,
> if they so desired, but more importantly a "Link - OBJR" element is
> required to make the link focusable. I believe that most tools
> automatically create this these days, but I can't say all. Depending on the
> audience, having them tab through a PDF may be something to consider.
>
> --
> Ryan E. Benson
>
>
> On Thu, Feb 13, 2025 at 1:40 PM Philip Kiff via WebAIM-Forum <
> = EMAIL ADDRESS REMOVED = > wrote:
>
>> Hi Birkir,
>>
>> On 2025-02-13 12:00 p.m., Birkir R. Gunnarsson via WebAIM-Forum wrote:
>>> One requirement is to make sure all interactive elements have a focus
>>> indicator. You can easily remove that in a browser but I don't know if it
>>> needs to be tested in a PDF document (can the document authors somehow
>>> remove the focus outline?)
>> No, for most "static" PDFs, I don't think you need to test for this. The
>> "focus" indicator is not normally something that is written into the
>> PDF, but rather something that is applied by whatever software you use
>> to read the PDF. Some PDF readers allow users to customize how they want
>> links or input fields to appear during interactions.
>>
>> If you are creating "dynamic" fillable PDFs that use XFA (XML Forms
>> Architecture), then I think you would need to test all the interactions,
>> including focus indicators. That format gives you a lot of control over
>> the user interface. But creating accessible "dynamic" XML forms is
>> highly specialized work, and creating accessible forms is always a
>> challenge, and not something that can be fixed or tested with basic checks.
>>
>> On 2025-02-13 12:00 p.m., Birkir R. Gunnarsson via WebAIM-Forum wrote:
>>
>>> The other check is to make sure that links in a block of text are
>>> underlined. Again, can the author of a PDF document do things like
>> removing
>>> default underlines from links or bookmarks?
>> Definitely you should check that links are underlined or otherwise
>> indicated clearly. Most PDF software allows creators to remove such
>> marks - there is an actual setting called "invisible" that you can apply
>> to a link annotation in a PDF. When applied, the only way that some
>> users can discover the links is when they happen to hover their mouse
>> above the relevant piece of text. I would follow current WCAG best
>> practices when interpreting whether links require underlines in a PDF or
>> if some other visually distinct indicator is acceptable. Underlining and
>> colouring in blue is the most widely recognized method for standard PDF
>> text documents.
>>
>> Phil.
>>
>> Philip Kiff
>> D4K Communications
>>
>>
From: Steve Green
Date: Tue, Feb 18 2025 10:10AM
Subject: Re: Can you remove link underlines and focus indicators in PDF documents?
← Previous message | No next message
If anyone else didn’t receive the test file and would like it, please contact me off-list.
The text colour does not affect the focus indicator colour, so a high contrast link may well have a low contrast focus indicator. Passing the test for text contrast tells you nothing about the focus indicator contrast.
In Chrome, you are seeing the same dotted black outline that I see in Edge, which makes sense. I just checked on another machine, and that also has a dotted black outline in Chrome. The first machine has Acrobat as the default PDF reader, which may account for the difference, although I don’t know why it would.
Steve
From: Philip Kiff < = EMAIL ADDRESS REMOVED = >
Sent: 18 February 2025 16:10
To: WebAIM Discussion List < = EMAIL ADDRESS REMOVED = >
Cc: Steve Green < = EMAIL ADDRESS REMOVED = >
Subject: Re: [WebAIM] Can you remove link underlines and focus indicators in PDF documents?
That is super interesting to me, Steve!
Thanks so much for taking the time to figure out how the algorithm in Adobe Reader works, explaining it to the list, and for sharing the test file (which I received off-list because you cc'd me - the mailing list otherwise strips out attachments, I think).
I guess I've never actually carefully thought about - or even carefully observed (!) - the differences in how focus colour and background colour interact with link colour in different PDF software readers.
In the sample links in the PDF you sent, I notice that most (or all?) cases of colour contrast failures for focus indicator vs background, the link text itself would also fail to meet colour contrast minimums for standard foreground vs background text. So perhaps - at least with Adobe Reader - the current algorithm should lead to a focus indicator that meets minimum colour contrast guidelines, provided that your link text itself also does?
Also, while checking the PDF viewers in Firefox and Chrome just now, I don't see the "dual colour" black and white focus indicator in Chrome? I do see a dual colour indicator in Firefox, with black then white outlines, which as you say, will force the focus to become visible regardless of background. When I tried to test in Chrome, all I seem to be getting is a dotted black focus indicator, which remains the same colour regardless of background colour. And which is therefore entirely invisible against a black background. Though maybe my browser/system dark mode/accessibility settings are affecting Chrome's display. I'm testing with Windows 11, Chrome 133.0.6943.99 64-bit.
Like I say, this is all new learning for me, and very interesting, thanks.
Phil.
On 2025-02-14 3:14 a.m., Steve Green via WebAIM-Forum wrote:
Adobe Reader automatically sets the colour of the focus indicator based on the link's background colour. This could have worked really well, but they created an incredibly stupid algorithm for doing it. The result is that in terms of WCAG conformance, the focus indicator has sufficient colour contrast against some background colours but not against others. Fortunately, you can choose background colours that you know will have sufficient contrast.
The algorithm is very simple. They simple deduct the hex colour of the background from #FFFFFF to get the focus indicator colour. If the background is #E26B0A (which is a dark orange), the focus indicator will be #1D94F5, which gives a colour contrast ratio of 1.04 so the focus indicator is virtually invisible. But if the background is #FFCC99 (which is a light orange), the focus indicator is #003366, giving a contrast ratio of 8.62.
I have attached a test file containing a variety of background colours that I used to verify the algorithm works the way I described above.
It's worth noting that Adobe Reader calculates the focus indicator colour for individual dots in its dotted outline. The result is that some parts of the focus indicator colour will be different from other parts if the link overlays an irregular background colour such as a gradient or an image. In marginal situations, this increases the chance of at least some of focus indicator having sufficient contrast.
Of course, other PDF readers will apply different focus indicator colours. In the Edge browser, the focus indicator colour varies between pure black and almost pure black depending on the background colour, so it is non-conformant against many background colours and is even worse than Adobe Reader.
Chrome uses its dual colour black and white focus indicator, so it has sufficient colour contrast against all background colours. Likewise, Firefox uses its dual colour blue and white focus indicator.
Steve Green
Managing Director
Test Partners Ltd