Android : MuPDF Error when rendering

on Saturday, October 11, 2014


I get this error when rendering the pdf file, anybody know what it could be?


Somehow the bm is a null, as if I add a nullpointer check it works but then only one and one piece is rendered. canvas = new Canvas(bm);



java.lang.RuntimeException: An error occured while executing doInBackground()
at com.artifex.mupdflib.AsyncTask$3.done(AsyncTask.java:331)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at com.artifex.mupdflib.AsyncTask$SerialExecutor$1.run(AsyncTask.java:261)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.NullPointerException
at android.graphics.Canvas.<init>(Canvas.java:136)
at com.artifex.mupdflib.MuPDFCore.drawPage(MuPDFCore.java:244)
at com.artifex.mupdflib.MuPDFPageView$17.doInBackground(MuPDFPageView.java:596)
at com.artifex.mupdflib.MuPDFPageView$17.doInBackground(MuPDFPageView.java:1)
at com.artifex.mupdflib.MuPDFCancellableTaskDefinition.doInBackground(MuPDFCancellableTaskDefinition.java:34)
at com.artifex.mupdflib.CancellableAsyncTask$1.doInBackground(CancellableAsyncTask.java:34)
at com.artifex.mupdflib.AsyncTask$2.call(AsyncTask.java:319)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
... 4 more
java.lang.NullPointerException
at android.graphics.Canvas.<init>(Canvas.java:136)
at com.artifex.mupdflib.MuPDFCore.drawPage(MuPDFCore.java:244)
at com.artifex.mupdflib.MuPDFPageView$17.doInBackground(MuPDFPageView.java:596)
at com.artifex.mupdflib.MuPDFPageView$17.doInBackground(MuPDFPageView.java:1)
at com.artifex.mupdflib.MuPDFCancellableTaskDefinition.doInBackground(MuPDFCancellableTaskDefinition.java:34)
at com.artifex.mupdflib.CancellableAsyncTask$1.doInBackground(CancellableAsyncTask.java:34)
at com.artifex.mupdflib.AsyncTask$2.call(AsyncTask.java:319)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at com.artifex.mupdflib.AsyncTask$SerialExecutor$1.run(AsyncTask.java:261)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)


Thanks for every answer :)


0 comments:

Post a Comment