flutter_pdf_viewer 0.6.1

Sponsor pub package

flutter pdf viewer #

A native Pdf viewer for flutter, built on AndroidPdfViewer.

P.S. Android Only!

Features #

  • Night Mode
  • Scroll Bar
  • Horizontal swipe
  • Pinch to zoom
  • Show inline Videos in Pdf
  • Immersive mode
  • Page by page analytics

Security #

  • Features fast native speed XOR - decryption of files.
  • Password protected pdf.
  • Display PDF from bytes without ever touching the disk!

Drawbacks #

  • Inline Pdf Viewing is not supported. ( A new activity is opened ). See #1.

    A proof of concept for inline PDFs is available at the inline branch.

Install #

To use this plugin, follow the installation instructions.

License: MIT

NOTE: You must add these lines at android/app/build.gradle.

(This is required by ExoPlayer, which is used to play videos).

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8

Example #

$ git clone https://github.com/pycampers/flutter_pdf_viewer.git
$ cd flutter_pdf_viewer/example
$ flutter run

Preview #

Generating 64-bit APKs #

The Underlying native library tends to blow up the APK size. So, you can build a separate APK for each CPU architecture.

This will also fix an issue with flutter tooling, where 64-bit ARM devices don't work.

Add the following section in android/app/build.gradle -

android {
    defaultConfig {
        ndk {
            abiFilters "<arch>"
  • For 32-bit APK, replace <arch> with armeabi-v7a, and run $ flutter build apk --release as usual.

  • For 64-bit APK, replace <arch> with arm64-v8a, and run $ flutter build apk --release --target-platform=android-arm64.

Now you have 2 Apks, which you will need to publish separately to the Play Store. For that you need to tweak the android:versionCode property to have slightly different values for each build.

The exact "Rules for multiple APKs" can be found here.

Thanks #


0.0.1 #

  • TODO: Describe initial release.


flutter_pdf_viewer_example #

Demonstrates how to use the flutter_pdf_viewer plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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

  flutter_pdf_viewer: ^0.6.1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_pdf_viewer/flutter_pdf_viewer.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Aug 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

The package description is too short. (-5 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
crypto ^2.0.6 2.1.2
flutter 0.0.0
plugin_scaffold ^1.1.1 1.1.1
Transitive dependencies
charcode 1.1.2
collection 1.14.11 1.14.12
convert 2.1.1
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8