Skip to content

longdt57/Pdf-View

Folders and files

NameName
Last commit message
Last commit date

Latest commit

470fb4b · Jun 4, 2022

History

10 Commits
Jun 4, 2022
Jun 2, 2022
Jun 2, 2022
Jun 4, 2022
Jun 2, 2022
Jun 2, 2022
Jun 4, 2022
Jun 2, 2022
Jun 2, 2022
Jun 2, 2022
Jun 2, 2022
Jun 2, 2022

Repository files navigation

Pdf-View

Version

ScreenShots

Implementation

build.gradle

repositories {
  maven { url "https://jitpack.io" }
}

[module]/build.gradle


dependencies {
  implementation 'com.github.longdt57:Pdf-View:{version}'
}

Usage

1. PdfView

<lee.module.pdfview.pdf.PdfView
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
  • Set Data by Uri: pdfView.setUri(...)
  • Set Data by PdfRenderer: pdfView.setPdfRenderer(renderer)

2. Open Pdf File

// pdf file Uri
val uri = ...

Intent(Intent.ACTION_VIEW).apply {
    val type = "application/pdf"
    setDataAndType(uri, type)
    addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
    startActivity(this)
}

References:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published