Overview
This section explains how to integrate CPDFReaderView into an Android app and how to use the core viewer features for reading workflows, including document state handling, display modes, page navigation, text search, zooming, themes, and accessibility support.
If you're integrating the viewer for the first time, start with the basic setup and then move through the feature guides you need.
Starting from version 2.6.6, the ComPDF Android PDF viewer supports TalkBack accessibility, providing spoken feedback and focus guidance for key viewer interactions to help developers build a more accessible reading experience.
Recommended Reading Order
For first-time integration, read these pages in order:
- Start with Using CPDFReaderView to complete the basic setup.
- Then review Document State and Error Callbacks to handle loading status and exceptions.
- If your app needs screen reader support, continue with TalkBack Accessibility Support to review the supported version, validation steps, and integration guidance.
- Continue with the display modes, navigation, search, and theme topics as needed.
In This Section
Overview and Integration
Add
CPDFReaderViewto an XML layout and complete the basic setup for the PDF viewer.Document State and Error Callbacks
Listen for document loading status, error messages, and mode changes so your app can handle failures and viewer state changes.
Basic Reading
Configure single-page, double-page, book, flip, and continuous scrolling modes, as well as crop mode and view mode.
Jump to a target page and listen for page movement and scrolling events in the viewer.
Adjust the page zoom level to match different reading preferences and display scenarios.
Use preset themes or custom colors to support different reading environments.
Document Navigation
Use the document outline to move through chapters and content structure more efficiently.
Manage bookmarks and jump back to saved locations in the document.
Text Interaction
Search for keywords, highlight matched results, and extract text from page ranges.
Retrieve the text currently selected in the viewer.
Reflow page text so it fits better on different screen sizes.
Interaction Enhancements
Highlight Form Fields and Hyperlinks
Highlight form fields and hyperlinks to make interactive content easier to find.
Render PDF pages as images for export, preview, or downstream processing.
Advanced Customization
Customize the context menu to add quick actions during reading workflows.
Accessibility
TalkBack Accessibility Support
Review the supported version, validation steps, and integration guidance for TalkBack in the Android PDF viewer.