AndroidPdfViewer icon indicating copy to clipboard operation
AndroidPdfViewer copied to clipboard

bottom part of page is always blur when opened in high resolution

Open weizai opened this issue 4 years ago • 11 comments

resolution : 3840 x 2160

Snipaste_2021-01-24_13-30-57

weizai avatar Jan 24 '21 05:01 weizai

resolution : 3840 x 2160, and this can be happened when zoom levels on max(3.0) , sample file is here sample.pdf

weizai avatar Jan 29 '21 02:01 weizai

same issue!

argmnt avatar Feb 15 '21 22:02 argmnt

--in pdfviewer.util; --in Constants.java file

changing line below public static float PART_SIZE = 250; to: public static float PART_SIZE = 600; worked for me!

I did not dig that much about this static field but since this is a static field, according to your pdf size resolution, you can change value of this static field before rendering PdfView !!!


While setting this field rendering waiting time, below part shouldn't be forgetten; As doc says: /** * The size of the rendered parts (default 256) * Tinier : a little bit slower to have the whole page rendered but more reactive. * Bigger : user will have to wait longer to have the first visual results */

Change will effect to waiting time. So What you can do is adjusting value of PART_SIZE field but for better waiting rendering time you can make a trade-off between MAXIMUM_ZOOM and PART_SIZE fields. For example; You can say this MAXIMUM_ZOOM value suits my app requirements then according to that zoom value, You can set minumum value of PART_SIZE field!

Fields: Constants.java public static float PART_SIZE public static float MAXIMUM_ZOOM = 10;

argmnt avatar Feb 16 '21 00:02 argmnt

@argmnt hello.. i have edited PART_SIZE to 600 but still blur on when rendered the page. This my configuration : pdfView.fromUri(uri) .defaultPage(pageNumber) .onPageChange(this) .enableAnnotationRendering(true) .onLoad(this) .scrollHandle(new DefaultScrollHandle(this)) .spacing(10) // in dp .onPageError(this) .pageFitPolicy(FitPolicy.BOTH) .swipeHorizontal(true) .autoSpacing(true) .enableSwipe(true) .pageSnap(true) .fitEachPage(true) .pageFling(true) .load();

laabroo avatar Feb 18 '21 06:02 laabroo

Have you tried higher values for PART_SIZE?

argmnt avatar Feb 18 '21 14:02 argmnt

@argmnt Yes i have. I edited to 600. public static float PART_SIZE = 600;

This my Sample PDF

laabroo avatar Feb 18 '21 14:02 laabroo

Maybe because of bitmap config, it is RGB 565. Can you try pdfView.useBestQuality(true);

Here is update from CHANGELOG.md

2.7.0-beta.1 (2017-07-05)

  • Updates PdfiumAndroid to 1.7.0 which reduces memory usage about twice and improves performance by using RGB 565 format (when not using pdfView.useBestQuality(true))

argmnt avatar Feb 18 '21 15:02 argmnt

I have used this line : pdfView.useBestQuality(true); but still blur. Could you try use this sample ?

@argmnt i use 3.2.0-beta.1 version.

laabroo avatar Feb 22 '21 06:02 laabroo

@argmnt i'm using 3.2.0-beta.1. I have add pdfview.useBestQuality(true); looks good for page 1 but for the next page still blurry.

laabroo avatar Feb 23 '21 02:02 laabroo

@laabroo You need to set autospacing to False.I was having the same issue in my pdf app so i just turned off the autospacing feature and the issue was resolved.

lightstudioapp avatar Mar 08 '21 13:03 lightstudioapp

same issue! I try public static float PART_SIZE = 600; not work I try with the .autoSpacing(false) not work.

Does anyone have another possibility?

Hector122 avatar Feb 25 '23 20:02 Hector122