Android Question PDFIUM Library problem processing links in PDF files exported from MS Word

PJLPJLPJL

Member
Licensed User
I am trying out the fabulous PDFIUM library and finding it very helpful.
However, I have caught one problem with the latest version's (1.04) new facility to intercept links when clicked in the PDF file.
I have added the ".addlinkhandler" function to my configurator load statement, and included a "Pdfium_LinkEvent(link As Map)" sub (copied from the library instructions).
When I open a pdf file produced from Adobe Acrobat it handles the links perfectly.
But when I open a pdf file exported from MS Word the app crashes with the following log entry:

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toString()' on a null object reference
at de.donmanfred.Configuratorwrapper$10.handleLinkEvent(Configuratorwrapper.java:235)
at com.github.barteksc.pdfviewer.listener.Callbacks.callLinkHandler(Callbacks.java:177)
at com.github.barteksc.pdfviewer.DragPinchManager.checkLinkTapped(DragPinchManager.java:103)
at com.github.barteksc.pdfviewer.DragPinchManager.onSingleTapConfirmed(DragPinchManager.java:69)
at android.view.GestureDetector.onTouchEvent(GestureDetector.java:671)
at com.github.barteksc.pdfviewer.DragPinchManager.onTouch(DragPinchManager.java:285)
at android.view.View.dispatchTouchEvent(View.java:13467)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3216)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2888)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2904)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2904)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2904)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2904)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:731)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1879)
at android.app.Activity.dispatchTouchEvent(Activity.java:3487)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:689)
at android.view.View.dispatchPointerEvent(View.java:13719)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6145)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5923)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5372)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5425)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5391)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5550)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5399)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5607)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5372)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5425)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5391)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5399)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5372)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8432)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8365)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8318)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8547)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:198)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:181)
at android.app.ActivityThread.main(ActivityThread.java:7078)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)

Is this a bug, or am I doing something wrong?
Sample program attached.
Huge thanks :)
 

Attachments

  • Test.zip
    314.4 KB · Views: 120
Top