PdfView-Android

Additional

Language
Java
Version
1.0.0 (Aug 3, 2019)
Created
Jan 26, 2019
Updated
Aug 24, 2019
Owner
Dmitry Borodin (Dmitry-Borodin)
Contributor
Dmitry Borodin (Dmitry-Borodin)
1
Activity
Badge
Generate
Download
Source code
APK file

Promotion

pdfview

Android PDF view - small (73kB .aar file, ~400 methods before minification) and efficient PDF viewer embedded in your native app

It is based on ImageView and can handle big files with reasonable scrolling and zooming performance.

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 a file.

If pdf is on remote host - use your network client to download it to the cache folder, then show it. This library provides view, it doesn't do network requests.

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.