Skip to content

A Android PDF Viewer that render pdf using PdfRenderer and displays it in a RecyclerView.

License

Notifications You must be signed in to change notification settings

danjdt/android-pdfviewer

Repository files navigation

Android PDFViewer

A Android PDF Viewer that render pdf using PdfRenderer + kotlin coroutines and displays it in a RecyclerView.

- This code will not be published as a library, but you can use it as you want.

- Requires API Level 21

How to use

    PdfViewer.Builder(rootView, lifecycleScope)
      .build()
      .load(file)

Setup options

    PdfViewer.Builder(rootView)
      .controller(PdfViewController)
      .quality(PdfPageQuality)
      .setZoomEnabled(Boolean)
      .setMaxZoom(Float)
      .setOnPageChangedListener(onPageChangedListener)
      .setOnErrorListener(onErrorListener)
      .setRenderDispatcher(Dispatchers.Default)
      .build()
      .load(file)

File load options

    pdfViewer.load(file : File)
    pdfViewer.load(url : String)
    pdfViewer.load(@RawRes resId : Int)
    pdfViewer.load(inputStream : InputStream)
    pdfViewer.load(uri : Uri)

Sample images/gifs

Scroll Zoom

About

A Android PDF Viewer that render pdf using PdfRenderer and displays it in a RecyclerView.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages