Qoppa PDF Android 空指针

Qoppa PDF Android NullPointer

我正在我的应用程序中尝试 qoppapdf,它在以下代码中遇到了 NullPointer:

 PDFDocument pdf = null;
    try {
        pdf = new PDFDocument(url, null);
    } catch (PDFException e) {
        e.printStackTrace();
    }
    PDFPage page = pdf.getPage(0);

错误为:

06-01 17:29:59.687  24761-24761/app W/dalvikvm﹕ Exception Ljava/lang/NullPointerException; thrown while initializing Lcom/qoppa/android/pdfProcess/PDFPage;
06-01 17:29:59.687  24761-24761/app D/AndroidRuntime﹕ Shutting down VM
06-01 17:29:59.687  24761-24761/app W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x413d22a0)
06-01 17:29:59.757  24761-24763/app D/dalvikvm﹕ GC_CONCURRENT freed 2569K, 26% free 10659K/14343K, paused 4ms+13ms, total 68ms
06-01 17:29:59.757  24761-24761/app E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.ExceptionInInitializerError
            at com.qoppa.android.pdfProcess.PDFDocument.b(Unknown Source)
            at com.qoppa.android.pdfViewer.e.p.b(Unknown Source)
            at com.qoppa.android.pdfProcess.PDFDocument.b(Unknown Source)
            at com.qoppa.android.pdfProcess.PDFDocument.<init>(Unknown Source)
            at com.qoppa.android.pdfProcess.PDFDocument.<init>(Unknown Source)
            at com.qoppa.android.pdfProcess.PDFDocument.<init>(Unknown Source)

用作输入的 url 是有效的,并且可以与其他 PDF-Viewer 一起正常工作。 有没有人遇到过这个或类似的问题?我做错了吗?

很高兴收到你的来信:-)

请在加载文档前添加以下代码:

//这个静态允许sdk访问字体资源,
//必须在使用库之前设置
StandardFontTF.mAssetMgr = getAssets();