0

Firstly I need a built-in Pdf Viewer which can decrypt the pdf. So I started to search. I tried PDF.js, Xfinium & Apitron (They were just editing tools.) and lastly I was too close with the Android L PdfRenderer.

I couldn't accomplished my task with PdfRenderer because it can't open encrypted pdfs. And I tried combo of two libraries such as PdfRenderer & Xfinium but whole copy, decrypt, paste, and render stuff was too slow.

I tried Radaee implenetation but I am getting this error:

10-23 01:54:59.600 I/MonoDroid(15262): UNHANDLED EXCEPTION:
10-23 01:54:59.610 I/MonoDroid(15262): Java.Lang.UnsatisfiedLinkError: Exception of type 'Java.Lang.UnsatisfiedLinkError' was thrown.
10-23 01:54:59.610 I/MonoDroid(15262): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Users/builder/data/lanes/2185/53fce373/source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:61
10-23 01:54:59.610 I/MonoDroid(15262): at Android.Runtime.JNIEnv.CallIntMethod (intptr,intptr,Android.Runtime.JValue*) [0x00064] in /Users/builder/data/lanes/2185/53fce373/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:404
10-23 01:54:59.610 I/MonoDroid(15262): at Com.Radaee.Pdf.Document.Open (string,string) [0x0007e] in C:\Users\Tarik\Desktop\HOLOGRAM\Xamarin Forms\Xamarin.Forms.PDFViewer-master\radaee33\obj\Debug\generated\src\Com.Radaee.Pdf.Document.cs:2662
10-23 01:54:59.610 I/MonoDroid(15262): at SmagHologram.PdfViewActivity.InitializePdfRenderer () [0x00097] in C:\Users\Tarik\Desktop\HOLOGRAM\smag_stuff\HoloMag\SmagHologram\SmagHologram\Activities\PdfViewActivity.cs:261
10-23 01:54:59.610 I/MonoDroid(15262): at SmagHologram.PdfViewActivity.OnCreate (Android.OS.Bundle) [0x000c8] in C:\Users\Tarik\Desktop\HOLOGRAM\smag_stuff\HoloMag\SmagHologram\SmagHologram\Activities\PdfViewActivity.cs:85
10-23 01:54:59.610 I/MonoDroid(15262): at Android.Support.V4.App.FragmentActivity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) <IL 0x00013, 0x00113>
10-23 01:54:59.610 I/MonoDroid(15262): at (wrapper dynamic-method) object.0e73d999-d8ed-4cd1-81a1-4ff16defbc5d (intptr,intptr,intptr) <IL 0x00017, 0x00027>
10-23 01:54:59.610 I/MonoDroid(15262):   --- End of managed exception stack trace ---
10-23 01:54:59.610 I/MonoDroid(15262): java.lang.UnsatisfiedLinkError: No implementation found for long com.radaee.pdf.Document.open(java.lang.String, java.lang.String) (tried Java_com_radaee_pdf_Document_open and Java_com_radaee_pdf_Document_open__Ljava_lang_String_2Ljava_lang_String_2)
10-23 01:54:59.610 I/MonoDroid(15262):  at com.radaee.pdf.Document.open(Native Method)
10-23 01:54:59.610 I/MonoDroid(15262):  at com.radaee.pdf.Document.Open(Document.java:406)
10-23 01:54:59.610 I/MonoDroid(15262):  at md5d55d75e2e923f69563bc550581d20657.PdfViewActivity.n_onCreate(Native Method)
10-23 01:54:59.610 I/MonoDroid(15262):  at md5d55d75e2e923f69563bc550581d20657.PdfViewActivity.onCreate(PdfViewActivity.java:29)
10-23 01:54:59.610 I/MonoDroid(15262):  at android.app.Activity.performCreate(Activity.java:6500)
10-23 01:54:59.610 I/MonoDroid(15262):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
10-23 01:54:59.610 I/MonoDroid(15262):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3072)
10-23 01:54:59.610 I/MonoDroid(15262):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3218)
10-23 01:54:59.610 I/MonoDroid(15262):  at android.app.ActivityThread.access$1000(ActivityThread.java:198)
10-23 01:54:59.610 I/MonoDroid(15262):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1676)
10-23 01:54:59.610 I/MonoDroid(15262):  at android.os.Handler.dispatchMessage(Handler.java:102)
10-23 01:54:59.610 I/MonoDroid(15262):  at android.os.Looper.loop(Looper.java:145)
10-23 01:54:59.610 I/MonoDroid(15262):  at android.app.ActivityThread.main(ActivityThread.java:6837)
10-23 01:54:59.610 I/MonoDroid(15262):  at java.lang.reflect.Method.invoke(Native Method)
10-23 01:54:59.610 I/MonoDroid(15262):  at java.lang.reflect.Method.invoke(Method.java:372)
10-23 01:54:59.610 I/MonoDroid(15262):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
10-23 01:54:59.610 I/MonoDroid(15262):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) 

Do you have any idea what happens here? Or do you know exact way of Radaee implementation to Xamarin.Android?

TarikGuren
  • 83
  • 1
  • 6

2 Answers2

0

this because u not invoked Global.Init();

to use radaee PDF lib, u shall copy native libs and resources to your project and invoke Global.Init() when APP start.

lyz
  • 16
0

You must call Global.Init() first to load the native Library.

You can check their demo on Github, and you can also check this guide

After following the guide, you only need to do the following to render a pdf:

RadaeePDFManager mPdfManager = new RadaeePDFManager();
mPdfManager.Show(this, filePath, password);
Nour
  • 1
  • 1