Skip to content
pubscout

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.

WASM-ready
$ flutter pub add alh_pdf_view
Source repository

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.