Source link: https://github.com/Dmitry-Borodin/pdfview-android
Here an example how to create Pdf view in Android. This library called pdfview-android. You can try it the code on Github.Thank for developer : https://github.com/Dmitry-Borodin
pdfview
Android PDF view - small and efficient PDF viewer embedded in your native app
It is based on ImageView and can handle big files with reasonable performance on low-end devices.
This is how fast scrolling of 680 page document looks like on low-end device:
Usage:
To show pdf you just need a file on the device.
findViewById<PDFView>(R.id.activityMainPdfView).fromAsset("paper.pdf").show()
See sources for other methods to provide file.
Add to your project:
The library is hosted in jcenter, it is available by default on new android projects
repositories {
<...>
jcenter()
}
Add gradle dependency:
implementation "com.pdfview:pdfview-android:1.0.0"
Thanks to Manuel Lilienberg for initial implementation of this library and subsampling-scale library for influence.