Skip to content

[Bug]: Accessibility support in the PDF.js web viewer (web/viewer.html) #20114

@Karthikvenkat86

Description

@Karthikvenkat86

Attach (recommended) or Link to PDF file

I’m assessing accessibility support in the PDF.js web viewer (web/viewer.html). Currently, all text—including headers—is rendered as plain elements, without semantic roles like role="heading" or aria-level. Are there UI settings I’m missing, or is this a known limitation/bug in the viewer?

As of now, its generates a Header where screen reader cannot identify this as a header.

Image

Web browser and its version

Edge

Operating system and its version

Windows 11

PDF.js version

v5.3.93

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

Generate a browser version of PDF and header doesn't have proper roles.

https://matrix.to/#/!NofDvGEWAARHltVRTj:mozilla.org/$-0tsHB06haPW340J8k8XD_HcJd0879uftHG-LhtN-C0?via=mozilla.org&via=matrix.org&via=igalia.com

Image

What is the expected behavior?

Need proper accessiblity label and roles for every element.

If its header then role=header, if its table then role="table"

What went wrong?

No proper roles

Link to a viewer

its private

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions