Beta PDFium - Pdfview2

Marco Nissen

Active Member
Licensed User
Longtime User
Regarding the new PDF library wrapper by @DonManfred

Hi, I still get the ontap issue - if I tap the pdf, I get the error below with the sample code (no change)

java.lang.Exception: Sub pdfium_ontap was not found.
    at anywheresoftware.b4a.BA.raiseEvent2(
    at anywheresoftware.b4a.BA$
    at android.os.Handler.handleCallback(
    at android.os.Handler.dispatchMessage(
    at android.os.Looper.loop(
    at java.lang.reflect.Method.invoke(Native Method)

Any idea? This looks like a bug to me.

Also, do you possibly know how get to know when the user performed a zoom action?
Like a rendering event ? There is one function called "addOnRenderListener", which could probably do that, but none of the provided events are called
Also not for the addOnDrawListener ..

From the PDFAndroidViewer original code I think the ondrawlistener should be added to the wrapper to implement the behavior

Thank you


Licensed User
Longtime User
Try v1.01 (download on Dropbox)

Sub Pdfium_onTap(event As Object)
End Sub
Sub Pdfium_onPageScrolled(arg0 As Int, arg1 As Float)
End Sub
Sub Pdfium_onLayerDrawn(cnvs As Object, arg1 As Float, arg2 As Float, arg3 As Int)
    Dim jocnvs As JavaObject = cnvs ' Honestly i don´t know what we can do with it :D
    ' The Canvas is a android.view.DisplayListCanvas

    Log($"Pdfium_onLayerDrawn(${arg1},${arg2},${arg3} (Zoom = ${PDFView1.Zoom}))"$)
End Sub
Also, do you possibly know how get to know when the user performed a zoom action?
Zoom is a Property of the pdfView. See the Pdfium_onLayerDrawn event above. I´m using the Zoom here. You can get the Zoom in a timer if you want. Or at any time.
Upvote 0