joanzapata / android-pdfview Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] A fast PDF reader component for Android development
Home Page: http://joanzapata.com/android-pdfview/
License: GNU General Public License v3.0
[DEPRECATED] A fast PDF reader component for Android development
Home Page: http://joanzapata.com/android-pdfview/
License: GNU General Public License v3.0
Hi i ran into problem, when i try to open a pdf which is remaining some part downloaded, the application crashes
02-18 14:58:52.749: E/AndroidRuntime(32014): FATAL EXCEPTION: AsyncTask #3 02-18 14:58:52.749: E/AndroidRuntime(32014): Process: com.sfworx.droids.it_ebooks, PID: 32014 02-18 14:58:52.749: E/AndroidRuntime(32014): java.lang.RuntimeException: An error occured while executing doInBackground() 02-18 14:58:52.749: E/AndroidRuntime(32014): at android.os.AsyncTask$3.done(AsyncTask.java:300) 02-18 14:58:52.749: E/AndroidRuntime(32014): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) 02-18 14:58:52.749: E/AndroidRuntime(32014): at java.util.concurrent.FutureTask.setException(FutureTask.java:222) 02-18 14:58:52.749: E/AndroidRuntime(32014): at java.util.concurrent.FutureTask.run(FutureTask.java:242) 02-18 14:58:52.749: E/AndroidRuntime(32014): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 02-18 14:58:52.749: E/AndroidRuntime(32014): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 02-18 14:58:52.749: E/AndroidRuntime(32014): at java.lang.Thread.run(Thread.java:841) 02-18 14:58:52.749: E/AndroidRuntime(32014): Caused by: java.lang.RuntimeException: PDF file is corrupted 02-18 14:58:52.749: E/AndroidRuntime(32014): at org.vudroid.pdfdroid.codec.PdfDocument.open(Native Method) 02-18 14:58:52.749: E/AndroidRuntime(32014): at org.vudroid.pdfdroid.codec.PdfDocument.openDocument(PdfDocument.java:28) 02-18 14:58:52.749: E/AndroidRuntime(32014): at org.vudroid.pdfdroid.codec.PdfContext.openDocument(PdfContext.java:18) 02-18 14:58:52.749: E/AndroidRuntime(32014): at org.vudroid.core.DecodeServiceBase.open(DecodeServiceBase.java:59) 02-18 14:58:52.749: E/AndroidRuntime(32014): at com.joanzapata.pdfview.DecodingAsyncTask.doInBackground(DecodingAsyncTask.java:49) 02-18 14:58:52.749: E/AndroidRuntime(32014): at com.joanzapata.pdfview.DecodingAsyncTask.doInBackground(DecodingAsyncTask.java:1) 02-18 14:58:52.749: E/AndroidRuntime(32014): at android.os.AsyncTask$2.call(AsyncTask.java:288) 02-18 14:58:52.749: E/AndroidRuntime(32014): at java.util.concurrent.FutureTask.run(FutureTask.java:237) 02-18 14:58:52.749: E/AndroidRuntime(32014): ... 3 more
See #46
I ran into a regular crash when i was using the component to display various pdf file : on the left pane the name of the file and when the user click on a name, the pdf is displayed on the right.
Switching quickly between files to display led me into a RunTimeException in the function :static PdfPage createPage(long dochandle, int pageno){ return new PdfPage(open(dochandle, pageno), dochandle); }
in
org.vudroid.pdfdroid.codec.PdfPage
.
A little investigation led me to find that this happened when two threads was calling this function at the same time.
Allow to show an "about" file
Hi,
For some reason, I am unable to render some particular files.
Here is the link to the files -
https://drive.google.com/folderview?id=0ByOGTe_MnFxcMW8wdEJrTnEtaTA
I was earlier thinking that the library was having issues in rendering all files of large sizes.
This issue is not there for every file or above a specified file limit. I have tried many other files of 30MB - 46 MB (one file of 58MB also got rendered) and they got rendered pretty well. But, I am not sure why is it not rendering these specific files.
It just tries to load this file and the the Activity goes black and nothing is displayed at all.
Can you look into this and see what is the issue with rendering of this file?
Hi i'm using your PDF viewer and my goes crash .Please help ASAP. Below is my application crash log.
07-02 08:44:44.202: E/AndroidRuntime(32162): java.lang.RuntimeException: error loading page
07-02 08:44:44.202: E/AndroidRuntime(32162): at org.vudroid.pdfdroid.codec.PdfPage.open(Native Method)
07-02 08:44:44.202: E/AndroidRuntime(32162): at org.vudroid.pdfdroid.codec.PdfPage.createPage(PdfPage.java:55)
07-02 08:44:44.202: E/AndroidRuntime(32162): at org.vudroid.pdfdroid.codec.PdfDocument.getPage(PdfDocument.java:18)
07-02 08:44:44.202: E/AndroidRuntime(32162): at org.vudroid.core.DecodeServiceBase.getPage(DecodeServiceBase.java:175)
07-02 08:44:44.202: E/AndroidRuntime(32162): at org.vudroid.core.DecodeServiceBase.getPageWidth(DecodeServiceBase.java:214)
07-02 08:44:44.202: E/AndroidRuntime(32162): at com.joanzapata.pdfview.PDFView.loadComplete(PDFView.java:626)
07-02 08:44:44.202: E/AndroidRuntime(32162): at com.joanzapata.pdfview.DecodingAsyncTask.onPostExecute(DecodingAsyncTask.java:58)
07-02 08:44:44.202: E/AndroidRuntime(32162): at com.joanzapata.pdfview.DecodingAsyncTask.onPostExecute(DecodingAsyncTask.java:1)
The library is good, however the text visibility is poor even when zooming.
Are you has a solution?
Hey,
I used the component to display this PDF file : https://www.mtn.co.za/Documents/yellodeals%20_april.pdf
Adode 9 file (PDF version 1.7) using JPEG2000 image non flattened. On rendering, the component display black area in place of theses images :
And with the same file flattened PDF with 1.4 compatibility :
A clue about how to fix this ? Tested with VuDroid Application, and got the same issue.
java.lang.RuntimeException: An error occured while executing doInBackground()
Caused by: java.lang.RuntimeException: PDF file is corrupted
at:
static PdfDocument openDocument(String fname, String pwd)
{
return new PdfDocument(open(FITZMEMORY, fname, pwd));
}
in PdfDocument class
E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1
Process: it.programmatica.reader, PID: 4942
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load vudroid from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/it.programmatica.reader-2.apk"],nativeLibraryDirectories=[/data/app-lib/it.programmatica.reader-2, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at org.vudroid.core.VuDroidLibraryLoader.load(VuDroidLibraryLoader.java:13)
at org.vudroid.pdfdroid.codec.PdfContext.<clinit>(PdfContext.java:13)
at com.joanzapata.pdfview.DecodingAsyncTask.doInBackground(DecodingAsyncTask.java:50)
at com.joanzapata.pdfview.DecodingAsyncTask.doInBackground(DecodingAsyncTask.java:31)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
thanks
Initially adviced by Romain Guy
Because a SurfaceView’s content does not live in the application’s window, it cannot be transformed (moved, scaled, rotated) efficiently. This makes it difficult to use a SurfaceView inside a ListView or a ScrollView. SurfaceView also cannot interact properly with some features of the UI toolkit such as fading edges or View.setAlpha().
TextureView creates a regular View instead of a new window and can therefore be translated, animated, etc... and easily added on components like lists.
TextureView is only available from API level 14, so I'd need to externalize rendering code and switch implementations regarding the OS version (I should probably check the hardware acceleration too).
Hello guys,
In order to read an arabic book, i need to make my pdf swipe orientation to RTL,
So is there some config to make this change or we need to develop this task ?
Thanks in advance ...
Should enable pdf:show_minimap="true|false"
and pdf:enableSwipe="true|false"
.
It appears an apklib is uploaded to maven.org but not an aar. An aar would allow gradle to automatically import this dependancy.
i cat't open sdcard pdf file...please support this.use you http://search.maven.org/#search|ga|1|g%3A%22com.joanzapata.pdfview%22 jar file.
Hi,
I found your library very useful. Great work :)
I am developing a commercial application where i want to use your library. Since you are using GPL 3 license, i understand that if i use your library, i have to expose source of my application also. Is this understanding correct ?
I can't expose source code of my application, is there different license i can use to use your library ? e.g. http://www.apache.org/licenses/LICENSE-2.0 or http://creativecommons.org/licenses/by/2.5/ ?
Thanks a lot for your time. Looking forward for a positive reply.
Regards,
Ashwani Kr Sharma
A problem occurred configuring project ':app'.
Could not download artifact 'com.joanzapata.pdfview:android-pdfview:1.0.0:android-pdfview.jar'
Artifact 'com.joanzapata.pdfview:android-pdfview:1.0.0:android-pdfview.jar' not found.
is it possible to jump to a specific page? (edit: jumpToPage())
Is it possible to search for a string in the pdf?
Hi,
I finding the PDF Viewer that supported clickable link(or url) on the pdf file, Is it possible to do that?
Thank you.
Hi @JoanZapata, I have already spent too long trying to get the Vudroid.so dep included in my project's build. I recommend testing the pdfview with AS and seeing if you can come to a solution, as it stands now it is broken because at run time the Vudroid.so lib is not loaded.
It would be great if there was at least an options to remove the current ios-like over scrolling implementation and use EdgeEffect instead which gives a much more native look and feel.
Hi,
I am planing to use this library in one of my android app. And i am using Eclipse as my IDE. I tried to import library project, but it seem to have errors like package name problem. Even though i fix that, it shows org.vudroid.core.VuDroidLibraryLoader not found. If you could guide in this, it would be great. And its also great if you could provide JAR directly in downloads.
Right now, some pdfs are displayed in portrait mode while the device is in landscape (see image). I guess this is due to the calculations (width height of a page). But this is pretty strange behaviour I think so it would be nice if there was an extra setting that forces all pages to be displayed horizontal or vertical.
So that the pages are readable in the same orientation the device is in..
As of now, the user has to swipe in horizontal direction to navigate between the pages. Is it possible to have the same in vertical direction?
For example if I want to use pdfView in viewPager. I should tracked that that pdfView on previous page was recycled, before showing pdf on current page.
Prerequisite for #8.
The current DSL forces to reconfigure the whole object.
java
pdfView.fromAsset(pdfName)
.pages(0, 2, 1, 3, 3, 3)
.defaultPage(1)
.showMinimap(false)
.enableSwipe(true)
.onDraw(onDrawListener)
.onLoad(onLoadCompleteListener)
.onPageChange(onPageChangeListener)
.load();
The only relevant part of it is:
``` java
pdfView.fromAsset(pdfName) // or fromFile(), fromXXX(), ...
.pages(0, 2, 1, 3, 3, 3)
.defaultPage(1)
.onLoad(onLoadCompleteListener)
.load();
Other methods should be available at any time, not only in the initialization phase.
This is related to #8 because setting the callbacks should be done on configuration change, but not load(), the methods need to be splited.
Caused by: java.lang.UnsatisfiedLinkError: Native method not found: main.java.org.vudroid.pdfdroid.codec.PdfDocument.open:(ILjava/lang/String;Ljava/lang/String;)J
Is it possible to set a LongClickListener to a PDFView like this?
PDFView.setOnLongClickListener
or maybe the PDFView has its own method to do it?
Thanks in advance
Please correct me if i´m wrong but i think that this library is not allowed to use the apache v2 license.
Since parts of vudroid´s source are used, which is licensed under GLP v3, it must be licensed under GLP too.
Hi, this library looks very promising.
I see there are posts about using it with eclipse but I could not find a working solution.
I added "android-pdfview" as a libary project into eclipse and then I added it to my own project. Everything seems to be fine and eclipse does not complain.
However as soon as I try to open a pdf my app crashes (runtimeexception).
My code looks like this:
PDFView pdfView = (PDFView) findViewById(R.id.pdfview);
pdfView.fromAsset("test.pdf")
.defaultPage(1)
.load();
Is it possible to double tap to zoom? The only thing it does is double tap to reset zoom.
Hello ,
Thanks for sharing great library project. How can I get each pdf page as independent bitmap. In this project two or three pages are rendering as one big bitmap.
Thanks in advance
Does this component provide text search feature inside PDF?
How do we open password protected PDF documents. The code crash when document is password protected.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.