Popularity
2.0
Growing
Activity
0.0
Stable
39
4
17

Description

Lightweight PDF Renderer Android

Library for displaying PDF documents on Android, with animations, gestures, zoom and double tap support.Works on API 21 (Android 5.0) and higher.

Programming language: Java
License: Cod

AndroidPdfViewer alternatives and similar packages

Based on the "Animations" category.
Alternatively, view AndroidPdfViewer alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of AndroidPdfViewer or a related project?

Add another 'Animations' Package

README

AndroidPdfViewer

Lightweight PDF Renderer Android

Library for displaying PDF documents on Android, with animations, gestures, zoom and double tap support.Works on API 21 (Android 5.0) and higher.

Installation

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
        repositories {
            ...
            maven { url 'https://www.jitpack.io' }
        }
    }

Step 2. Add the dependency

dependencies {
            implementation 'com.github.manishkummar21:AndroidPdfViewer:1.0'
    }

# Include PDFViewActivity in your manifest file

 <activity android:name="com.github.pdfviewer.PDFViewActivity" />

# Load a PDF file from anywhere in your code

 PDFView.with(context)
        .fromfilepath(fileapth)
        .swipeHorizontal(false) //if false pageswipe is vertical otherwise its horizontal
    .start();

//Example of loading pdf file from asset folder


 File file = new File(getCacheDir(), "sample.pdf");
        if (!file.exists()) {

            try {
                InputStream asset = getAssets().open("sample.pdf");
                FileOutputStream output = null;
                output = new FileOutputStream(file);
                final byte[] buffer = new byte[1024];
                int size;
                while ((size = asset.read(buffer)) != -1) {
                    output.write(buffer, 0, size);
                }
                asset.close();
                output.close();
            } catch (IOException e) {
                e.printStackTrace();
            }

        }


        PDFView.with(this)
                .fromfilepath(file.getAbsolutePath()))
                .swipeHorizontal(false)
                .start()

ScreenShot

ScreenShot