Giter VIP home page Giter VIP logo

afreakyelf / pdf-viewer Goto Github PK

View Code? Open in Web Editor NEW
732.0 13.0 157.0 1.08 MB

A Lightweight PDF Viewer Android library which only occupies around 80kb while most of the Pdf viewer occupies up to 16MB space.

Home Page: https://afreakyelf.github.io/Pdf-Viewer/

License: MIT License

Kotlin 99.31% Python 0.69%
android android-application androidsdk library pdf pdfviewer kotlin android-pdf android-pdfviewer small-size-pdfviewer

pdf-viewer's Introduction

Pdf Viewer For Android

A Simple PDF Viewer library which only occupies around 80kb while most of the Pdf viewer occupies upto 16MB space.

Maven Central License Visitors CodeFactor Discord

[New] Join our Discord Community here!

✨ Major Enhancements in Our PDF Viewer Library ✨

Hello Developers! We're thrilled to share some significant enhancements we've made to our PDF viewer library. We've fine-tuned several aspects to enhance your experience and ensure top-notch performance and security. Here's what's new:

  • Jetpack Compose Ready 🚀

    Step into the future with Jetpack Compose compatibility. Integrating our PDF viewer in Compose projects is now effortless, thanks to the PdfRendererViewCompose composable function.
  • Turbocharged Performance 🏎️

    We've optimized performance to handle PDFs more efficiently, ensuring swift and smooth operations, even with large documents.
  • Local and on device files 📁

    We have made it better and smooth with how local files are handled now, with latest permission policies.
  • Seamless Orientation Adaptation 🔄

    Our library now smartly preserves your page position during orientation changes, ensuring uninterrupted reading sessions.
  • Enhanced File Path Security 🔐

    Security just got stronger. We've revamped our file path handling to provide robust protection against directory traversal attacks, keeping your data safer than ever.
  • Streamlined Caching System 💾

    Experience efficiency at its best! Our refined caching strategy smartly manages storage, retaining only the most recent PDF file to optimize performance and space usage.
  • Discreet Screenshot Prevention Feature 🚫📸

    Privacy matters. Our new screenshot-blocking feature enhances data confidentiality in your app, keeping sensitive information secure from prying eyes.
  • Flexible UI Customization ✨

    Your design, your rules. Enjoy complete freedom in customizing the PDF viewer's interface, ensuring a perfect match with your app's style and theme. Render the view directly in your screen now.
  • 'NoActionBar' Theme Compatibility 🎨

    Seamless aesthetics, no matter the theme. Our library now gracefully integrates with 'NoActionBar' themes, ensuring a cohesive and appealing user interface.

Stay tuned as we continue to innovate and improve. Happy coding, and let's keep creating amazing experiences together!

How to integrate into your app? ⚙️

We have migrated our library to Maven Central for easier integration and better reliability. To use the Pdf Viewer library in your project, add the following dependency to your build.gradle file:

Latest version: without 'v'

Groovy DSL

dependencies {
    // Replace 'latest-version' with the actual latest version number
    implementation 'io.github.afreakyelf:Pdf-Viewer:latest-version'
}

Kotlin DSL

dependencies {
    // Replace 'latest-version' with the actual latest version number
    implementation("io.github.afreakyelf:Pdf-Viewer:latest-version")
}

How to use the library?

Now you have integrated the library in your project but how do you use it? Well it's really easy. Just launch the intent with in following way: (Refer to MainActivity.kt for more details.)

Prerequisites

Ensure the library is included in your project's dependencies.

Launching PDF Viewer

Opening PDF from a URL

To display a PDF from a URL, use the following code:

/* Parameters:
- context: The context of your activity.
- pdfUrl: URL of the PDF to be displayed.
- pdfTitle: Title of the PDF document.
- saveTo: Determines how to handle saving the PDF (e.g., ASK_EVERYTIME prompts the user each time).
- enableDownload: Enables downloading of the PDF. */

PdfViewerActivity.launchPdfFromUrl(
    context = this,
    pdfUrl = "your_pdf_url_here",
    pdfTitle = "PDF Title",
    saveTo = PdfViewerActivity.saveTo.ASK_EVERYTIME,
    enableDownload = true
)

Opening PDF from Local Storage

To open a PDF stored in local storage:

/* Parameters:
- path: File path or URI of the local PDF.
- fromAssets: Set to false when loading from local storage. // FALSE by default
*/

PdfViewerActivity.launchPdfFromPath(
    context = this,
    path = "your_file_path_or_uri_here",
    pdfTitle = "Title",
    saveTo = PdfViewerActivity.saveTo.ASK_EVERYTIME,
    fromAssets = false
)

Opening PDF from Assets

To open a PDF from the app's assets folder:

/* Parameters:
- path: File path or URI of the local PDF.
- fromAssets: Set to true when loading from assets.
*/

PdfViewerActivity.launchPdfFromPath(
  context = this,
  path = "file_name_in_assets",
  pdfTitle = "Title",
  saveTo = PdfViewerActivity.saveTo.ASK_EVERYTIME,
  fromAssets = true
)

Loading PDF in a View

Load a PDF directly into a view:

Add PDF render view in your layout file

<com.rajat.pdfviewer.PdfRendererView
    android:id="@+id/pdfView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:pdfView_divider="@drawable/pdf_viewer_divider"
    app:pdfView_showDivider="false" />

and in your kotlin file

binding.pdfView.initWithUrl(
  url = "your_pdf_url_here",
  lifecycleCoroutineScope = lifecycleScope,
  lifecycle = lifecycle
)

Using with Jetpack Compose

For Jetpack Compose, utilize PdfRendererViewCompose:

PdfRendererViewCompose(
    url = "your_pdf_url_here",
    lifecycleOwner = LocalLifecycleOwner.current
)

That's pretty much it and you're all wrapped up.

Ui Customizations

You need to add the custom theme to styles.xml/themes.xml file and override the required attribute values. Parent theme can be either Theme.PdfView.Light or Theme.PdfView.Dark or the one with no actionbar from the application. Note: If parent is not one of the themes from this library, all of the pdfView attributes should be added to that theme.

<style name="Theme.PdfView.SelectedTheme" parent="@style/Theme.PdfView.Light">
    <item name="pdfView_backIcon">@drawable/ic_arrow_back</item>
    <item name="pdfView_showToolbar">true</item>
    <item name="pdfView_disableScreenshots">true</item>
    ...
</style>

Ui Customizations - Page number

You need to add the custom layout to pdf_view_page_no.xml file and override the required attribute values.

<?xml version="1.0" encoding="utf-8"?>  
<TextView xmlns:android="http://schemas.android.com/apk/res/android"  
  android:id="@+id/pageNo"  
  android:layout_width="wrap_content"  
  android:layout_height="wrap_content"  
  android:layout_margin="18dp"  
  android:background="#9C27B0"  
  android:paddingStart="12dp"  
  android:paddingTop="4dp"  
  android:paddingEnd="12dp"  
  android:paddingBottom="4dp"  
  android:textColor="#ffffff"  
  android:textSize="16sp"  
  android:visibility="gone" />

Ui Page number

You need to add the custom string to strings.xml file and override the required strings.xml values.

Default:

<string name="pdfView_page_no">%1$s of %2$s</string>

Custom:

<string name="pdfView_page_no" >%1$s / %2$s</string>

Supported attributes

Attribute Name Type Expected changes
pdfView_backIcon drawable Navigation icon
pdfView_downloadIcon drawable Download icon
pdfView_downloadIconTint color Download icon tint
pdfView_actionBarTint color Actionbar background color
pdfView_titleTextStyle style Actionbar title text appearance
pdfView_progressBar style Progress bar style

Who's using Pdf-Viewer?

👉 Check out who's using Pdf-Viewer

Contributing

Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/NewFeature)
  3. Commit your Changes (git commit -m 'Add some NewFeature')
  4. Push to the Branch (git push origin feature/NewFeature)
  5. Open a Pull Request

Donations

If this library helps you save time during development, you can buy me a cup of coffee :)

paypal

Author

Maintained by Rajat Mittal

pdf-viewer's People

Contributors

afreakyelf avatar bharathvishal avatar chihung93 avatar devyam avatar husseinhj avatar imgbot[bot] avatar jafesch avatar joymajumdar2001 avatar loong-t avatar mgov4fun avatar phucynwa avatar simonskayi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pdf-viewer's Issues

App crashes OutOfMemoryError

Please check help me.
pdf file about 18MB, and open it via url.

Logs:
Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 26952076 byte allocation with 16777216 free bytes and 18MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(VMRuntime.java)
at android.graphics.Bitmap.nativeCreate(Bitmap.java)
at android.graphics.Bitmap.createBitmap(Bitmap.java:893)
at android.graphics.Bitmap.createBitmap(Bitmap.java:870)
at android.graphics.Bitmap.createBitmap(Bitmap.java:837)
at com.rajat.pdfviewer.PdfRendererCore.buildBitmap(PdfRendererCore.kt:119)
at com.rajat.pdfviewer.PdfRendererCore.access$buildBitmap(PdfRendererCore.kt:23)
at com.rajat.pdfviewer.PdfRendererCore$renderPage$1.invokeSuspend(PdfRendererCore.kt:93)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

image

External Control of File Name or Path

Describe the bug
We performed an analysis on our code with Veracode and detected the follow flaw on library, especifically on class PdfRendererCore.kt

CWE-73: External Control of File Name or Path
Flaw Category: Directory Traversal
Description: The software allows user input to control or influence paths or file names that are used in filesystem operations.

This could allow an attacker to access or modify system files or other files that are critical to the application.
Path manipulation errors occur when the following two conditions are met:

  1. An attacker can specify a path used in an operation on the filesystem.
  2. By specifying the resource, the attacker gains a capability that would not otherwise be permitted.
    For example, the program may give the attacker the ability to overwrite the specified file or run with a configuration controlled by the attacker.

Attack Vector: pdfViewer/src/main/java/com/rajat/pdfviewer/PdfRendererCore.kt: 52 and pdfViewer/src/main/java/com/rajat/pdfviewer/PdfRendererCore.kt: 65

Additional context
Veracode scan is required by our client and managed by him in regards to the process to point out a false negative. So it would be nice to point out if there are any risks or changes that can be made. Thanks.

Adding a slider

It would be great to add a slider to navigate quickly between pages, this feature already exist on the fat barteksc one's, I think it's a primordial features. Anyway very good library!

Give the PdfRenderView item a default height

Thanks for your nice work.
English is not my first language, I will try my best to describe my problem.

I implemented my own PdfViewerActivity by using PdfRendererView.
After opening a big pdf file, like more than 200 pages, the render core will try to build the bitmap all of the pages.
This is because that the height of the recycler view item is wrap_content, which means 0 pixel. So the recycler view will try to load as more items as possible which seems like "block" the rendering.
And, buildBitmap runs in a GlobalScope, the jobs won't be canceled when activity is destroyed. After close the large pdf and try to open a small pdf file, the rendering is still blocked since there are still lots of jobs remaining.

I think this can be fixed by giving list item a default height, such as 480dp, so that the recycler view won't request a lots of buildBitmap jobs.

Allow messages customization

I've notice that the activity PdfViewerActivity.kt has some toast messages with build in strings.
Could you please move all the embedded text (PdfViewerActivity.kt and other classes) in the string resource file?
In that case I could translate in italian language ^^ and other ppl can provide their own translations.

Thanks for your support.

Scroll state is not retained

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Home'
  2. Click on 'Open pdf'
  3. Scroll down to 'any page'
  4. Rotate the screen
  5. See error which is the scroll state is not retained and scrolling to the initial state

Expected behavior
While rotating the screen if the user scrolled down from first page to any other page expected to retain the page on rotation event.

Smartphone (please complete the following information):

  • Device: Samsung s10 Lite
  • OS: Android

Add a loading indicator if the PDF is not ready to be read

Describe the bug
Large PDFs are not fully loaded for the first few seconds after opening the activity. Only the first page or two are shown, the rest are rendered later. This period extends with the increasing size of PDF it is tested with.

To Reproduce
Steps to reproduce the behavior:

  1. Open a large PDF
  2. Try to scroll down

Expected behavior
I understand that the PDF needs to be loaded first. I would expect a loading circle of some sort while the PDF is not fully displayed as an indicator that the PDF is not yet ready to be read.

Screenshots

IFORH7Yl7X_Trim_Trim.mp4

Smartphone:
Device: [Nexus 10 (emulator)]
OS: [Android API 29]
Application version 1.0.7

pdf文件很大的时候比如一个119页的pdf滚动到最后面时 加载数据错乱,频繁刷新

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Changing Page Index Indicator Style/Text

Is your feature request related to a problem? Please describe.
We are using PdfRendererView in our project in production. I need to change page indicator text (see below) as our app is released in a foreign market where people cannot speak English.
image

Describe the solution you'd like
As a first step, maybe styling is not that much important, but the text itself is. At least, I would like to be able to make it something like "6 / 17".

Describe alternatives you've considered
No alternative is acceptable currently, because non-English speakers may not understand "of" in between of page index and total page count.

Not able to build the project

📝 Describe the Bug

When updated latest version, It's giving this error for building project.

📖 Library Version

  • PDF Viewer Version: : 2.0.3

📖 Project Version

  • minSdk 23
  • targetSdk 34
  • compileSdk 34

📖 Android studio Version

Android Studio Hedgehog | 2023.1.1
Build #AI-231.9392.1.2311.11076708, built on November 9, 2023
Runtime version: 17.0.7+0-17.0.7b1000.6-10550314 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.7.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 4
Metal Rendering is ON
Registry:
external.system.auto.import.disabled=true
debugger.new.tool.window.layout=true
ide.text.editor.with.preview.show.floating.toolbar=false
ide.experimental.ui=true
ide.images.show.chessboard=true

Non-Bundled Plugins:
com.intellij.marketplace (231.9392.3)
Dart (231.9409)
wu.seal.tool.jsontokotlin (3.7.4)
idea.plugin.protoeditor (231.9225.5)
dev.polek.adbwifi (1.2.5)
izhangzhihao.rainbow.brackets (2023.3.7)
io.flutter (76.3.3)

🚶 Steps to Reproduce

Please follow these steps to reproduce the issue:
Check attached image

Used this in my project

<uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="28" />

image

PDF has been corrupted

When I am using the v1.0.1 it's throwing the error PDF has been corrupted but when I am downgrading it to v1.0.6 then it's working fine.

Kindly revert any changes if you have done in v1.0.1 which might be causing the aformentioned error.

Get PDF URL From Protected Link

I need send header parameter for get pdf from url. I'm normally sending 'cookie' header value when i get image or pdf file. Can you develop add header feature for get pdf from url?

PdfViewerActivity Error

Using this in java and i am unable to get PdfViewerActivity, as it is showing not found error...(Dependency Added)

Not able to Sync library

After adding library Its not getting loaded
Failed to resolve: com.github.afreakyelf:Pdf-Viewer:v1.0.8

library version

implementation 'com.github.afreakyelf:Pdf-Viewer:v1.0.7'

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = "1.7.10"
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

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

plugins {
id 'com.android.application' version '7.4.0' apply false
id 'com.android.library' version '7.4.0' apply false
id 'org.jetbrains.kotlin.android' version '1.7.21' apply false
}

Font size

Can we change texts fontsize and colors?

[BUG] Jetpack Compose view has zero width

📝 Describe the Bug

Exactly what the title says. The view has zero width in Jetpack Compose. So I can't see the PDF right now

📖 Library Version

  • PDF Viewer Version: 2.0.4

🚶 Steps to Reproduce

Please follow these steps to reproduce the issue:

  1. Use Jetpack Compose
  2. Add a Column with modifier fillMaxSize, inside add a TopAppBar and a Box with fillMaxSize. Inside this Box set the PdfRendererViewCompose.

🤔 Expected Behavior

To see the PDF. If you could provide the modifier I could give it a width and height myself and this issue would be fixed.


Page index is not updating correctly

Describe the bug
When scrolling, the index of the page is not updating correctly. I've noticed it gets stuck especially when working with large PDFs.

To Reproduce
Steps to reproduce the behavior:

  1. Open a multi-page PDF
  2. Scroll
  3. Observe the page counter

Screenshots

Fe8AnzokVD.mp4

Smartphone (please complete the following information):

  • Device: [Nexus 10 (emulator)]
  • OS: [Android API 29]
  • Application version 1.0.7

Possible with JSON items?

I'm working on an app that has pdf urls in a json response, but the library doesn't seem to work with those. Do you possibly have a potential workaround and use for this?

Remove <uses-permission> and requestLegacyExternalStorage config from library manifest

The library AndroidManifest includes various permissions that the consuming app potentially does not need. These include:

  • requestLegacyExternalStorage
  • READ_PHONE_STATE
  • ACCESS_MEDIA_LOCATION

and others.

The library should not declare any of these permissions, nor requestLegacyExternalStorage, and instead make it the responsibility of the consuming app to declare what it needs.

Pdf has been corrupted.

Hello

I am using PdfDocument to crerate PDF file. I am saving this file to app's Internal filesDir.
Now when I run below code I am getting "Pdf has been corrupted" Toast message

startActivity(new PdfViewerActivity().Companion.launchPdfFromPath(Activity4.this, file.getAbsolutePath(), "", "", false));

So what can I do?

Thank you

App Crashing

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rsmssb.oldpaper/com.rajat.pdfviewer.PdfViewerActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ProgressBar.setVisibility(int)' on a null object reference

and using this

implementation 'com.github.afreakyelf:Pdf-Viewer:1.1.2'

startActivity(PdfViewerActivity.Companion.launchPdfFromUrl(PdfViewer.this, path, "PDF", "", false)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));

Files are downloading very let after downlaod button click

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Read Pdf From Remote URL With JAVA

Load pdf from url online with java not in assets
i have a pdf library saved in database online and i want users read these books online "preview" not from assets,
Can U Add it please

App crash when minimise and reopen app.

App crashed
Fatal Exception: java.lang.RuntimeException: Unable to stop activity {com.letzconnect/com.rajat.pdfviewer.PdfViewerActivity}: java.lang.IllegalStateException: Already closed
To Reproduce
Steps to reproduce the behavior:

  1. open PdfViewerActivity
  2. minimize the app
  3. Reopen the app from the minimized tray or from the launcher icon.
  4. the app will get crashed

Cause
onStop() binding.pdfView.closePdfREnder()
if you cant reproduce the case ping me.

Java.lang.RuntimeException: Canvas: trying to draw too large(128545280bytes) bitmap.

Describe the bug
App crashing because of a major bug. Not able to view PDFs with big pictures.

To Reproduce
Steps to reproduce the behavior:

  • Open a pdf with heavy pictures

Expected behavior
The app should not crash and view the pdf

Screenshots
App is crashing, simple

Smartphone (please complete the following information):

  • Device: All
  • Version All

Additional context
2021-09-04 14:49:36.853 810-810/io.esper.files D/AndroidRuntime: Shutting down VM 2021-09-04 14:49:36.876 810-810/io.esper.files E/AndroidRuntime: FATAL EXCEPTION: main Process: io.esper.files, PID: 810 java.lang.RuntimeException: Canvas: trying to draw too large(128545280bytes) bitmap. at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:260) at android.graphics.Canvas.drawBitmap(Canvas.java:1420) at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:545) at android.widget.ImageView.onDraw(ImageView.java:1286) at android.view.View.draw(View.java:18324) at android.view.View.updateDisplayListIfDirty(View.java:17302) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at androidx.recyclerview.widget.RecyclerView.drawChild(RecyclerView.java:5030) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at com.rajat.pdfviewer.PinchZoomRecyclerView.dispatchDraw(PinchZoomRecyclerView.kt:128) at android.view.View.draw(View.java:18327) at androidx.recyclerview.widget.RecyclerView.draw(RecyclerView.java:4429) at android.view.View.updateDisplayListIfDirty(View.java:17302) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.updateDisplayListIfDirty(View.java:17297) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.updateDisplayListIfDirty(View.java:17297) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.updateDisplayListIfDirty(View.java:17297) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.updateDisplayListIfDirty(View.java:17297) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.updateDisplayListIfDirty(View.java:17297) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.updateDisplayListIfDirty(View.java:17297) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.updateDisplayListIfDirty(View.java:17297) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.updateDisplayListIfDirty(View.java:17297) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.draw(View.java:18327) at com.android.internal.policy.DecorView.draw(DecorView.java:919) at android.view.View.updateDisplayListIfDirty(View.java:17302) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:692) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:698) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:806) at android.view.ViewRootImpl.draw(ViewRootImpl.java:3135) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2931) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2523) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1522) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7098) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927) at android.view.Choreographer.doCallbacks(Choreographer.java:702) at android.view.Choreographer.doFrame(Choreographer.java:638) 2021-09-04 14:49:36.876 810-810/io.esper.files E/AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6682) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

Pinch zoom feature request

Is your feature request related to a problem? Please describe.
I'm currently using PdfRendererView in my project. I want to add pinch-to-zoom functionality to it.

Describe the solution you'd like
I would like to enable this feature with a boolean flag, such as:
pdfRenderView.isPinchZoomEnabled = true

Describe alternatives you've considered
Not possible currently.

Double Tap to Zoom

Please add the Double Tap to Zoom feature, right now user's are not aware the PDF can be zoomed or not, some users don't explicitly try to Pinch to Zoom and leave it thinking the PDF can not be zoomed. It'll be great if Double Tap to Zoom can be by default.

Allow download from HTTP website

Hello,
thanks for your library.
Currently only HTTPS connections are allowed.
Could you add the possibility to get PDF from HTTP connection.

Cleartext HTTP traffic to ... not permitted

You could put an option to the current call:

fun launchPdfFromUrl(
            context: Context?,
            clearText: Boolean = false, //allow clear text (HTTP) connection
            pdfUrl: String?,
            pdfTitle: String?,
            directoryName: String?,
            enableDownload: Boolean = true
        )

storage app bloated fast.

Every time when showing the pdf, save the file to local, without being clear.
Issue is on pixel device.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.