Flutter Native PDF Viewer

A Flutter plugin for viewing PDF files with native implementation. Currently supports Android platform with features like text search, annotations, and zoom capabilities.

Features

  • Native PDF rendering for optimal performance
  • Text search with highlighting
  • Annotation support (drawing, highlighting, erasing)
  • Zoom and pan gestures
  • Support for loading PDFs from:
    • Local assets
    • File system
    • URLs (with automatic downloading and caching)

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_native_pdf_viewer: ^0.1.16

Usage:

import 'package:flutter_native_pdf_viewer/flutter_native_pdf_viewer.dart';

// Load from URL NativePdfView( url: 'https://example.com/sample.pdf', )

// Load from assets NativePdfView( filePath: 'assets/pdfs/sample.pdf', )

NativePdfView( url: 'https://example.com/sample.pdf', searchQuery: _searchQuery, currentMatchIndex: _currentMatchIndex, onSearchResultsChanged: (totalMatches, error) { setState(() { _totalMatches = totalMatches; }); }, )

NativePdfView( filePath: 'assets/pdfs/sample.pdf', annotationMode: 'draw', // Options: 'draw', 'highlight', 'erase', null annotationColor: Colors.red.value, annotationStrokeWidth: 5.0, enableAnnotations: true, )

Android iOS Web macOS Windows Linux ✅ ❌ ❌ ❌ ❌ ❌