TPTruPDF

Accessibility

WCAG 2.2 AA target. Live regions, keyboard navigation, focus management, screen-reader support, RTL.

Standard vs secure mode

AspectStandard modeSecure mode
Text layer DOMmounted, aria-hidden="false" for screen readersnot mounted
Page content for assistive techtext layer divslive region with structural reading order
Selection by browseryessuppressed
Copy / Ctrl+Callowedblocked
getTextContent()allowedblocked

The standard-mode text layer is invisible to sighted users (zero opacity, pointer-events: none) but readable by screen readers and search engines. Secure mode replaces it with a polite live region that announces page text in structural reading order.

Keyboard navigation

  • Tab / Shift+Tab — through every toolbar control, panel section, and modal.
  • Arrow keys — paginate (Up/Down), adjust sliders, navigate menus.
  • Enter / Space — activate buttons.
  • Escape — close modals, dismiss popovers.
  • Page Up / Page Down / Home / End — document navigation.

Default keyboard shortcuts

See Customization → Keyboard for the full map. Highlights:

  • Ctrl/Cmd+F — search.
  • Ctrl/Cmd+P — print.
  • Ctrl/Cmd+S — save.
  • Ctrl/Cmd+Z / Ctrl/Cmd+Shift+Z — undo / redo.
  • F11 — fullscreen.
  • Tool hotkeys (single letter): V, E, S, T, R, O, P, L, M, D, C.

All hotkeys can be overridden.

Live regions

AccessibilityManager exposes a polite live region for:

  • Page change announcements ("Page 4 of 12").
  • Annotation create / update / delete.
  • Form-field validation feedback.
  • Tool activation ("Highlight tool active").
  • License events (expiry warnings).

Focus management

  • Visible focus ring on every interactive element.
  • Focus trap inside modals (AnnotationLinkDialog, CalibrationDialog, PasswordModal, RedactConfirmDialog, PrintDialog).
  • Focus restoration when modals / panels close.
import { createSkipLink } from '@trupdf/viewer';
 
createSkipLink(host, [
  { id: 'main', label: 'Skip to document' },
  { id: 'toolbar', label: 'Skip to toolbar' },
  { id: 'comments', label: 'Skip to comments' },
]);

Color contrast

Theme tokens meet AA contrast at 4.5:1 minimum (dark theme verified; light theme verified for primary surfaces). A high-contrast theme preset ships for users who need 7:1+.

Zoom

Text sizes use rem so browser zoom up to 200% reflows correctly. UI reflows at 200%; toolbar overflow menu folds excess controls.

RTL

Arabic, Hebrew, and Farsi switch the viewer to RTL layout. Direction inherits from the i18n locale; manual override via dir="rtl" on the viewer container.

Reduced motion

Animation tokens (--trupdf-anim-fast, --trupdf-anim-base, --trupdf-anim-slow) auto-zero out when prefers-reduced-motion: reduce is set.

Audit

Run the bundled axe-core a11y suite:

pnpm --filter @trupdf/a11y test

Issues block CI. Visual regression for focus indicators runs in Playwright (apps/site/e2e).