AlpVir Well-Known Member Licensed User Longtime User Sep 25, 2020 #1 This code works perfectly with Android 5 and uses the PDFViewer 1.5 library. B4X: ub Globals Dim pdfV As PDFViewer Sub Activity_Create(FirstTime As Boolean PanelPDF.Initialize("PanelPDF") PanelPDF.color=Colors.White Activity.AddView(PanelPDF,0,0,100%x,100%y-25dip pdfV.init PanelPDF.AddView(pdfV,0,0,-1,-1) With Android 6 the pdfV.init line causes an error java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/alpvir.firmatablet2-1/lib/arm/libpdfview2.so: has text relocations at java.lang.Runtime.loadLibrary(Runtime.java:372) at java.lang.System.loadLibrary(System.java:1076) at de.donmanfred.pdfviewerwrapper.init(pdfviewerwrapper.java:104) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197) at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262) at alpvir.firmatablet2.main._crea(main.java:845) at alpvir.firmatablet2.main$ResumableSub_Activity_Create.resume(main.java:786) at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144) at anywheresoftware.b4a.BA.raiseEvent(BA.java:193) at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43) at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:137) at anywheresoftware.b4a.BA$2.run(BA.java:387) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5765) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679) Error occurred on line: 301 (Main) java.lang.Exception: array not expected... Click to expand... [/CODE]
This code works perfectly with Android 5 and uses the PDFViewer 1.5 library. B4X: ub Globals Dim pdfV As PDFViewer Sub Activity_Create(FirstTime As Boolean PanelPDF.Initialize("PanelPDF") PanelPDF.color=Colors.White Activity.AddView(PanelPDF,0,0,100%x,100%y-25dip pdfV.init PanelPDF.AddView(pdfV,0,0,-1,-1) With Android 6 the pdfV.init line causes an error java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/alpvir.firmatablet2-1/lib/arm/libpdfview2.so: has text relocations at java.lang.Runtime.loadLibrary(Runtime.java:372) at java.lang.System.loadLibrary(System.java:1076) at de.donmanfred.pdfviewerwrapper.init(pdfviewerwrapper.java:104) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197) at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262) at alpvir.firmatablet2.main._crea(main.java:845) at alpvir.firmatablet2.main$ResumableSub_Activity_Create.resume(main.java:786) at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144) at anywheresoftware.b4a.BA.raiseEvent(BA.java:193) at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43) at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:137) at anywheresoftware.b4a.BA$2.run(BA.java:387) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5765) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679) Error occurred on line: 301 (Main) java.lang.Exception: array not expected... Click to expand... [/CODE]
DonManfred Expert Licensed User Longtime User Sep 26, 2020 #2 Which library exactly you are using? I suggest to use this one as it is Compatible with 64bit requirement. PDFium - Pdfview2 This is a wrap for a PDF-View which is based on PDFium. It is based on these two Github-Projects: Pdfium and Android PDF-View The PDF-View is based on Pdfium 1.9 The Library, resp. the Natives inside, are 64bit Compliant btw. It supports Horizontal and Vertical scrolling, Pagesnap. PDFium... www.b4x.com Last edited: Sep 26, 2020 Upvote 0
Which library exactly you are using? I suggest to use this one as it is Compatible with 64bit requirement. PDFium - Pdfview2 This is a wrap for a PDF-View which is based on PDFium. It is based on these two Github-Projects: Pdfium and Android PDF-View The PDF-View is based on Pdfium 1.9 The Library, resp. the Natives inside, are 64bit Compliant btw. It supports Horizontal and Vertical scrolling, Pagesnap. PDFium... www.b4x.com
AlpVir Well-Known Member Licensed User Longtime User Sep 27, 2020 #3 The library is PDFViewer I should write at certain coordinates of the HTML text, but PDFium doesn't seem to allow that. Something like S="<body><html>abcdef</html></body>" pdf.writeHTML 0,30,100%x,100%y,S Upvote 0
The library is PDFViewer I should write at certain coordinates of the HTML text, but PDFium doesn't seem to allow that. Something like S="<body><html>abcdef</html></body>" pdf.writeHTML 0,30,100%x,100%y,S
DonManfred Expert Licensed User Longtime User Sep 27, 2020 #4 PDFium is a PDF-VIEWER. You can not create a PDF with it. Upvote 0