https://github.com/scientifichackers/flutter_pdf_viewer
A native PDF viewer for flutter.
https://github.com/scientifichackers/flutter_pdf_viewer
Last synced: 5 months ago
JSON representation
A native PDF viewer for flutter.
- Host: GitHub
- URL: https://github.com/scientifichackers/flutter_pdf_viewer
- Owner: scientifichackers
- License: mit
- Created: 2018-07-16T01:14:17.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-23T19:00:47.000Z (about 6 years ago)
- Last Synced: 2025-04-06T17:04:41.465Z (about 1 year ago)
- Language: Kotlin
- Homepage:
- Size: 10.3 MB
- Stars: 109
- Watchers: 7
- Forks: 40
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.jaaga.in/labs) [](https://pub.dartlang.org/packages/flutter_pdf_viewer)
# flutter pdf viewer
A native Pdf viewer for flutter, built on [AndroidPdfViewer](https://github.com/barteksc/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](https://github.com/pycampers/flutter_pdf_viewer/issues/1).
A proof of concept for inline PDFs is available at the [inline](https://github.com/pycampers/flutter_pdf_viewer/tree/inline) branch.
## Install
To use this plugin, follow the [installation instructions](https://pub.dartlang.org/packages/flutter_pdf_viewer#-installing-tab-).
License: MIT
#### NOTE: You must add these lines at `android/app/build.gradle`.
(This is required by [ExoPlayer](https://github.com/google/ExoPlayer), which is used to play videos).
```
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
```
## Example
```sh
$ 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 ""
}
}
}
```
- For 32-bit APK, replace `` with `armeabi-v7a`, and run `$ flutter build apk --release` as usual.
- For 64-bit APK, replace `` 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](https://developer.android.com/google/play/publishing/multiple-apks).
## Thanks
- [AndroidPdfViewer](https://github.com/barteksc/AndroidPdfViewer) for proving this wonderful, and simple to use library.
- [#10348](https://github.com/flutter/flutter/issues/10348).
---
[🐍🏕️](http://www.pycampers.com/)