[free lib]b4aPDFViewer by Icefairy333

artefact

Member
Licensed User
Longtime User
Hi !:)
It is possible to display a page with respect to a word in pdf
I want to search for a word on a page and the result is displayed on the page relate ...
Maybe with "scrollToFindResult Method" or "Method findOnPage"?!
Thank you for your answer
 

blouchris

New Member
Licensed User
Longtime User
App Crash

Hi,

When I use this library on a second Activity and close the activity after viewing PDF and start it again I get " Fatal signal 11 (SIGSEGV) at 0x00000014 (code=1) "

Any suggestions?
 

charmander

New Member
Licensed User
Longtime User
can you share code for the make some improvements for us please? pdf rendering is really detailed work and i want add my application some capabilities. (get all page's width and height to fit screen, centering etc)
 

francoisg

Active Member
Licensed User
Longtime User
Hi,
is there any chance of someone creating a wrapper for the MuPDF library / API (http://www.mupdf.com/)? We are in desperate need of a library to view PDF files but nothing seems to work 100%. Even this library (by icefairy333) kind-of works but is waaay to slow for bigger PDF files. Also you basically have no control over the view! I've played a bit with the example app using MuPDF and it works quite fast, allows for zoom & pan, allows for hot links etc ...
I would love to do it myself but it seems my abilities fall short when it comes to creating libraries for b4a! If the price is right we would even be willing to pay for a proper library + b4a wrapper! As long as it does what we need it to do! Basically display pdf files (fast & light) and allow control over a few things like page position, zoom level etc ...

We are busy writing an ebook reader application (free). Currently we support epub files but without pdf support the app would be useless :-(

And as a nice spinnoff, everyone using b4a would have a choice of libs for pdf files! ;-)
 

tucano2000

Active Member
Licensed User
Longtime User
I'm trying to implement a search text or words in pdf file using this library:

B4X:
Dim Result As List
Result.Initialize
Result.Clear
Dim pc As Int=0
pc=pdfv.GetPageCount
For n=1 To pc
       Result.Add(pdfv.findOnPage("my_search_string",n))
Next


Why to use the method FindOnPage the application stop and it returns this error in log ? There is a problem with the library? What am I doing wrong?


java.lang.UnsatisfiedLinkError: findOnPage
at cx.hell.android.lib.pdf.PDF.findOnPage(Native Method)
at ice.pdfviewer.pdfviewerwrapper.findOnPage(pdfviewerwrapper.java:150)
at b4a.example.main._btnprocurar_click(main.java:501)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:173)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:161)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:157)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:66)
at android.view.View.performClick(View.java:3511)
at android.view.View$PerformClick.run(View.java:14105)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
 
Last edited:

Sytek

Active Member
Licensed User
Longtime User
Sytek

findOnPage works to you ?
Sorry tucan but I don't quote your thread, I'm just giving my thoughts about the library in my device (if it runs/calls)
I will test the findonpage and let you know.

Regards!
 

Sytek

Active Member
Licensed User
Longtime User
Sorry tucan but I don't quote your thread, I'm just giving my thoughts about the library in my device (if it runs/calls)
I will test the findonpage and let you know.

Regards!

Hello tucano2000, since I don't need to search "at the moment" in pdf file just show them, I do not test that option.
Now, I'd tested and yes it throws the error you mentioned.
B4X:
PackageAdded: package:b4a.example
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
java.lang.UnsatisfiedLinkError: Native method not found: cx.hell.android.lib.pdf.PDF.findOnPage:(ILjava/lang/String;)Ljava/util/List;
    at cx.hell.android.lib.pdf.PDF.findOnPage(Native Method)
    at ice.pdfviewer.pdfviewerwrapper.findOnPage(pdfviewerwrapper.java:150)
    at b4a.example.main._search(main.java:486)
    at b4a.example.main._buttonsearch_click(main.java:410)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:174)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:162)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:158)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:66)
    at android.view.View.performClick(View.java:4240)
    at android.view.View$PerformClick.run(View.java:17726)
    at android.os.Handler.handleCallback(Handler.java:730)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:150)
    at android.app.ActivityThread.main(ActivityThread.java:5146)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)
 

cncncn

Member
Licensed User
Longtime User
Hi,


can you change the pdf (such as adding annotations) with this Library?

thank you for your future responses
 

Ron Davey

Member
Licensed User
Longtime User
There was a previous post:

Hi,

When I use this library on a second Activity and close the activity after viewing PDF and start it again I get " Fatal signal 11 (SIGSEGV) at 0x00000014 (code=1) "

Any suggestions?

I am having the same problem in that the first time I start the activity all works well, the next time my application restarts. Is there a way of releasing or clearing the memory associated with the PDFViewer object.

Again any suggestions would be appreciated.

Thanks
 

CapVidia

New Member
Licensed User
Longtime User
Can't download the library, the link has expired, i would also want to try it...
 

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hi,
is there any chance of someone creating a wrapper for the MuPDF library / API (http://www.mupdf.com/)? We are in desperate need of a library to view PDF files but nothing seems to work 100%. Even this library (by icefairy333) kind-of works but is waaay to slow for bigger PDF files. Also you basically have no control over the view! I've played a bit with the example app using MuPDF and it works quite fast, allows for zoom & pan, allows for hot links etc ...
I would love to do it myself but it seems my abilities fall short when it comes to creating libraries for b4a! If the price is right we would even be willing to pay for a proper library + b4a wrapper! As long as it does what we need it to do! Basically display pdf files (fast & light) and allow control over a few things like page position, zoom level etc ...

We are busy writing an ebook reader application (free). Currently we support epub files but without pdf support the app would be useless :-(

And as a nice spinnoff, everyone using b4a would have a choice of libs for pdf files! ;-)

hello Francoisg
I also have your own requirement. did you find solution? 're willing to share?
thank you very much
 

tucano2000

Active Member
Licensed User
Longtime User
i got compile and run mupdf on eclipse but i donĀ“t know build as library to basic4android. Sorry.
 

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hi Tucano
did you manage to solve your problem? if the solution you've found it works, I evaluate the .. I also have no problems using Eclispe. please can you give me some additional indication?
thank you very much
 

francoisg

Active Member
Licensed User
Longtime User
Does anyone know whether the PDFViewer's "getPageBitmap" method actually works?
It always returns null... Even when calling getPageBitmap after a delay (just to make sure the PDF is rendered)
 
Top