interactive_pdf_viewer 0.1.0
interactive_pdf_viewer: ^0.1.0 copied to clipboard
A Flutter package for displaying PDFs with the ability to retrieve sentences by tapping on their position.
Interactive PDF Viewer Example #
This example demonstrates how to use the interactive_pdf_viewer package in a Flutter application.
Features Demonstrated #
- Loading PDFs from different sources:
- Local file system (using file picker)
- Assets
- Remote URL
- Text selection and sentence tapping
- Error handling
- Page navigation
- Custom styling
Running the Example #
- Make sure you have Flutter installed and set up
- Navigate to the example directory:
cd example - Get the dependencies:
flutter pub get - Run the app:
flutter run
Usage #
The example app provides three ways to load a PDF:
- Pick PDF: Opens a file picker to select a PDF from your device
- Sample PDF: Loads a sample PDF included in the assets
- Remote PDF: Loads a PDF from a remote URL
Once a PDF is loaded, you can:
- Tap on text to select sentences
- Swipe to navigate between pages
- See the total number of pages
- View any errors that occur during loading
Screenshots #
(Screenshots will be added after the app is running)
Notes #
- The sample PDF is a simple one-page document
- The remote PDF is a dummy PDF from W3C
- Error handling is implemented for all operations
- The app uses Material 3 design
Improvements #
- Improve the text extraction algorithm to handle complex PDF layouts
- Enhance the position mapping to be more accurate
- Add support for different text selection modes (word, paragraph, etc.)
- Optimize performance for large PDFs
- Add more customization options