Radaee PDF Xamarin实施

时间:2015-10-22 23:07:04

标签: android pdf encryption xamarin pdfrenderer

首先,我需要一个可以解密pdf的内置Pdf Viewer。所以我开始搜索。我试过PDF.js,Xfinium& Apitron(他们只是编辑工具。)最后我与Android L PdfRenderer太接近了。

我无法使用PdfRenderer完成任务,因为它无法打开加密的pdf。我尝试了两个库的组合,例如PdfRenderer& Xfinium但整个复制,解密,粘贴和渲染的东西太慢了。

我尝试过Radaee实现,但是我收到了这个错误:

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) 

你知道这里发生了什么吗?或者你知道Ramaee实现到Xamarin.Android的确切方法吗?

1 个答案:

答案 0 :(得分:0)

这是因为你没有调用Global.Init();

使用radaee PDF lib,你应该将本机库和资源复制到你的项目中,并在APP启动时调用Global.Init()。