Accessibility
- The viewport is a focusable, labelled
role="document", and each page a labelled region. Name them in your application’s language withPdfViewport’slabelandpageLabel; the defaults are “PDF document” and “Page 3 of 12”. - The canvases are hidden from assistive technology, which reads the text layer instead.
- A tagged PDF’s structure gives that text its headings, paragraphs, lists, tables, and figures’ alternative text, as in pdf.js’s viewer.
- Text layers carry the PDF’s language (
/Lang), or the page’s when the PDF declares none, so screen readers announce the text in its language. - Links are focusable and activate with the keyboard; links within the document are named by the text they link.
- The keyboard scrolls, turns pages, and zooms: see Controls and state.
pageColorsdraws pages in two colors, for exampleCanvasandCanvasTextin forced-colors mode.- With
enforcePermissionsand a document that forbids copying, assistive technology still reads the text.
Applications own the rest of the interface: label your toolbar, announce
search results with an aria-live region as the search
guide does, and label the annotation editor’s controls with
annotationLabels.