alh_pdf_view
2.4.0, released 3 months ago by an unverified publisher
Show PDF files or bytes as a Flutter widget on Android and iOS.
What it does
Displays PDF documents from a file path or raw bytes within a widget. Provides a controller to navigate pages, adjust zoom, and handle gestures.
AI-written summary of version 2.4.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to display PDF files or bytes directly inside a Flutter widget on Android or iOS.
- You require interactive features like swiping, zooming, page jumping, and callbacks for page changes or rendering.
Skip it when
- You are targeting web or desktop platforms, as this package is restricted to Android and iOS.
- You need advanced PDF generation or modification capabilities.
Strengths
- Supports loading PDFs from both file paths and byte arrays.
- Includes a controller for programmatic navigation and zoom management.
- Platform-specific implementations handle native rendering efficiently on Android and iOS.
Weaknesses
- Only supports Android and iOS platforms.
- Android setup requires manually adding the JitPack repository.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Requires adding JitPack to your Android Gradle repositories in android/build.gradle.
import 'package:alh_pdf_view/alh_pdf_view.dart';
import 'package:flutter/material.dart';
class AlhPdfViewExample extends StatelessWidget {
const AlhPdfViewExample({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('PDF Example')),
body: const AlhPdfView(
filePath: 'ADD_PATH_TO_FILE',
),
);
}
}Alternatives
Packages that do the same job and could replace alh_pdf_view.
- path_provider_android
Android implementation of the path_provider plugin for finding commonly used locations.
79Compare - path_provider_foundation
iOS/macOS implementation of path_provider using direct FFI calls
78Compare - native_file_preview
A Flutter plugin providing native file preview capabilities for iOS and Android.
74Compare - file_saver
Save files from bytes, paths, streams, and URLs across Android, iOS, Web, Windows, macOS, and Linux.
87Compare