scientifichackers / flutter_pdf_viewer

A native PDF viewer for flutter.
MIT License
107 stars 40 forks source link

Sponsor pub package

flutter pdf viewer

A native Pdf viewer for flutter, built on AndroidPdfViewer.

P.S. Android Only!

Features

Security

Drawbacks

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>"
        }
    }
}

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


🐍🏕️