flutter_pdf_viewer
用於 Flutter 的原生 PDF 閱讀器。
- 星標
- 107
- 分支
- 40
- 最近推送(UTC)
- 2020年4月23日
- 專案狀態
- 未封存
原始 README
以下為英文專案原文快照,最新內容請造訪 GitHub。
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>witharmeabi-v7a, and run$ flutter build apk --releaseas usual. -
For 64-bit APK, replace
<arch>witharm64-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
- AndroidPdfViewer for proving this wonderful, and simple to use library.
- #10348.
使用的依賴
依賴清單 3 項
- flutter
{"sdk":"flutter"} - crypto
^2.0.6 - plugin_scaffold
^1.1.1
如何選擇適合專案的儲存庫?
先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
- 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
- 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
- 使用前在 GitHub 確認 README、授權條款與 Issues。
來源與維護
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗