Open Kerace opened 7 years ago
Which version do you use?
Here`s the same issue on android 4.4 , (4.4.4 / 4.4.2)many times,
AndroidPdfViewer 2.6.1
My version is 'com.github.barteksc:android-pdf-viewer:2.7.0-beta.1'
@Kerace Do you use pdfView.useBestQuality(true)
?
pdfView.fromFile(pdf)
.defaultPage(pageNumber)
.onPageChange(new OnPageChangeListener() {
@Override
public void onPageChanged(int page, int pageCount) {
pageNumber = page;
}
})
.enableAnnotationRendering(false)
.enableAntialiasing(true)
.scrollHandle(new DefaultScrollHandle(getContext()))
.spacing(10)
.load();
@barteksc I think I did not use it,and I try to setting pdfView.useBestQuality(false); My AOS is 4.1.1.
Have you solved this problem yet?I met the same problem, when I repeated or narrowed up and down again and again.I have set up pdfView.useBestQuality (false);
If you share the pdf I can test on a few devices different os.
@1stmetro thank you ,I've solved this problem.just change the size of the cache, as follows: public static class Cache {
/** The size of the cache (number of bitmaps kept) */
public static int CACHE_SIZE = 40;
public static int THUMBNAILS_CACHE_SIZE = 8;
}
I believe my cache size is dynamicically based upon the device.
I'm guessing that device has a small amount of ram.
yes,you are right.The ram of my device is really small.
I still have this problem when I use it in viewpager。Only the probability of the appearance is smaller.
i also met this issues on AndroidPdfViewer 3.0.0, is there any solution?
@SunnyTang 我把CACHE_SIZE改成30之后,目前没有再出现过
@microsoftBoy 谢谢!现在有相应的接口可以设置这个值吗?
@SunnyTang 我是通过源码依赖,本地修改的,你也可以尝试下直接为CACHE_SIZE赋值,应该也是可以的
大家打包都是用的哪个版本呢,咱们国内有没有QQ交流群呢 交流AndroidPdfViewer 使用
i also met this issues on AndroidPdfViewer 3.1.0-beta.1,has any solution?
After I open PDF File,(using this pdf.fromFile()) When i roll several times,it will throws OOM exception. my file size is 700kb. I think this is related to my phone?
The error log is as follows:
E/AndroidRuntime: FATAL EXCEPTION: PDF renderer java.lang.OutOfMemoryError at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:650) at android.graphics.Bitmap.createBitmap(Bitmap.java:630) at com.github.barteksc.pdfviewer.RenderingHandler.proceed(RenderingHandler.java:96) at com.github.barteksc.pdfviewer.RenderingHandler.handleMessage(RenderingHandler.java:71) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.os.HandlerThread.run(HandlerThread.java:60)