AndroidPdfViewer 1.x is available on AndroidPdfViewerV1 repo, where can be developed independently. Version 1.x uses different engine for drawing document on canvas, so if you don't like 2.x version, try 1.x.
Library for displaying PDF documents on Android, with animations
, gestures
, zoom
and double tap
support.
It is based on PdfiumAndroid for decoding PDF files. Works on API 11 (Android 3.0) and higher.
Licensed under Apache License 2.0.
- Merge PR #714 with optimized page load
- Merge PR #776 with fix for max & min zoom level
- Merge PR #722 with fix for showing right position when view size changed
- Merge PR #703 with fix for too many threads
- Merge PR #702 with fix for memory leak
- Merge PR #689 with possibility to disable long click
- Merge PR #628 with fix for hiding scroll handle
- Merge PR #627 with
fitEachPage
option - Merge PR #638 and #406 with fixed NPE
- Merge PR #780 with README fix
- Update compile SDK and support library to 28
- Update Gradle and Gradle Plugin
- Replaced
Contants.PRELOAD_COUNT
withPRELOAD_OFFSET
- Removed
PDFView#fitToWidth()
(variant without arguments) - Removed
Configurator#invalidPageColor(int)
method as invalid pages are not rendered - Removed page size parameters from
OnRenderListener#onInitiallyRendered(int)
method, as document may have different page sizes - Removed
PDFView#setSwipeVertical()
method
Add to build.gradle:
implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
or if you want to use more stable version:
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
Library is available in jcenter repository, probably it'll be in Maven Central soon.
If you are using ProGuard, add following rule to proguard config file:
-keep class com.shockwave.**
<com.github.barteksc.pdfviewer.PDFView
android:id="@+id/pdfView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
All available options with default values: