This project is no longer maintained.
Android PDFView is a library which provides a fast PDFView component for Android, with animations, gestures, and zoom. It's based on VuDroid for decoding the PDF file.
which is a fork relying on Pdfium instead of Vudroid/MuPDF for decoding PDF files, allowing it to use the Apache License 2.0 which gives you much more freedom.
Get it
Android PDFView is available in Maven Central.
<dependency>
<groupId>com.joanzapata.pdfview</groupId>
<artifactId>android-pdfview</artifactId>
<version>1.0.4</version>
<type>apklib</type>
</dependency>
Or via gradle:
compile 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'
Include PDFView in your layout
<com.joanzapata.pdfview.PDFView
android:id="@+id/pdfview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Load a PDF file
pdfView.fromAsset(pdfName)
.pages(0, 2, 1, 3, 3, 3)
.defaultPage(1)
.showMinimap(false)
.enableSwipe(true)
.onDraw(onDrawListener)
.onLoad(onLoadCompleteListener)
.onPageChange(onPageChangeListener)
.load();
pages
is optional, it allows you to filter and order the pages of the PDF as you needonDraw
is also optional, and allows you to draw something on a provided canvas, above the current page