我正在尝试加载pdf文件,但由于已有的PDF文件,我收到错误。
private PDFView pdfView;
pdfView = (PDFView) aboutus_layout.findViewById(R.id.pdfView);
pdfView.fromFile(file).onLoad(this).onPageChange(this).load();
@Override
public void onPageChanged(int page, int pageCount) {
// TODO Auto-generated method stub
}
@Override
public void loadComplete(int nbPages) {
// TODO Auto-generated method stub
if (isAdded()) {
if (pd.isShowing()) {
pd.dismiss();
Log.e("load complete", "load Complete");
}
}
}
这是堆栈跟踪:
04-21 09:51:01.619: E/AndroidRuntime(5944): FATAL EXCEPTION: main
04-21 09:51:01.619: E/AndroidRuntime(5944): java.lang.RuntimeException: error loading page
04-21 09:51:01.619: E/AndroidRuntime(5944): at org.vudroid.pdfdroid.codec.PdfPage.open(Native Method)
04-21 09:51:01.619: E/AndroidRuntime(5944): at org.vudroid.pdfdroid.codec.PdfPage.createPage(PdfPage.java:55)
04-21 09:51:01.619: E/AndroidRuntime(5944): at org.vudroid.pdfdroid.codec.PdfDocument.getPage(PdfDocument.java:18)
04-21 09:51:01.619: E/AndroidRuntime(5944): at org.vudroid.core.DecodeServiceBase.getPage(DecodeServiceBase.java:175)
04-21 09:51:01.619: E/AndroidRuntime(5944): at org.vudroid.core.DecodeServiceBase.getPageWidth(DecodeServiceBase.java:214)
04-21 09:51:01.619: E/AndroidRuntime(5944): at com.joanzapata.pdfview.PDFView.loadComplete(PDFView.java:635)
04-21 09:51:01.619: E/AndroidRuntime(5944): at com.joanzapata.pdfview.DecodingAsyncTask.onPostExecute(DecodingAsyncTask.java:55)
04-21 09:51:01.619: E/AndroidRuntime(5944): at com.joanzapata.pdfview.DecodingAsyncTask.onPostExecute(DecodingAsyncTask.java:1)
04-21 09:51:01.619: E/AndroidRuntime(5944): at android.os.AsyncTask.finish(AsyncTask.java:631)
04-21 09:51:01.619: E/AndroidRuntime(5944): at android.os.AsyncTask.access$600(AsyncTask.java:177)
04-21 09:51:01.619: E/AndroidRuntime(5944): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
04-21 09:51:01.619: E/AndroidRuntime(5944): at android.os.Handler.dispatchMessage(Handler.java:99)
04-21 09:51:01.619: E/AndroidRuntime(5944): at android.os.Looper.loop(Looper.java:176)
04-21 09:51:01.619: E/AndroidRuntime(5944): at android.app.ActivityThread.main(ActivityThread.java:5365)
04-21 09:51:01.619: E/AndroidRuntime(5944): at java.lang.reflect.Method.invokeNative(Native Method)
04-21 09:51:01.619: E/AndroidRuntime(5944): at java.lang.reflect.Method.invoke(Method.java:511)
04-21 09:51:01.619: E/AndroidRuntime(5944): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
04-21 09:51:01.619: E/AndroidRuntime(5944): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
04-21 09:51:01.619: E/AndroidRuntime(5944): at dalvik.system.NativeStart.main(Native Method)