Accessibility in Flutter PDF Viewer (SfPdfViewer)
5 Sep 20252 minutes to read
Screen Reader
The SfPdfViewer can be accessed by screen readers by wrapping the SfPdfViewer widget with the Semantics widget.
@override
Widget build(BuildContext context) {
return Scaffold(
body: Semantics(
label: 'Flutter PDF Viewer',
child:
SfPdfViewer.network(
'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf'),
),
);
}Sufficient Contrast
The SfPdfViewer theming support provides a consistent and standardized appearance, as well as the ability to set the colors for all UI elements.
The following APIs allow you to customize the colors of the following elements:
Large Fonts
The font size of the SfPdfViewer will be automatically scaled based on the device settings.
Also, you can change the font size of the SfPdfViewer elements using the following APIs:
Keyboard Navigation
The SfPdfViewer supports the following keyboard interactions:
| Action | Windows | Macintosh | Linux |
|---|---|---|---|
| Shortcuts for Page Navigation | |||
| Navigate to the first page | Home | Function+Left arrow | Home |
| Navigate to the last page | End | Function+Right arrow | End |
| Navigate to the previous page | Left arrow | Left arrow | Left arrow |
| Navigate to the next page | Right arrow | Right arrow | Right arrow |
| Shortcuts for Zooming | |||
| Perform zoom in operation | CONTROL + = | COMMAND + = | CONTROL + = |
| Perform zoom out operation | CONTROL + - | COMMAND + - | CONTROL + - |
| Reset the zoom level to 1 | CONTROL + 0 | COMMAND + 0 | CONTROL + 0 |
| Shortcut for Text Search | |||
| Open the search toolbar | CONTROL + F | COMMAND + F | CONTROL + F |
| Shortcut for Text Selection | |||
| Copy the selected text | CONTROL + C | COMMAND + C | CONTROL + C |
Easier Touch Targets
The SfPdfViewer has a touch target of 48 x 48, as per the standard for all elements.