android-pdfview icon indicating copy to clipboard operation
android-pdfview copied to clipboard

Visibility of text

Open Brionne opened this issue 10 years ago • 21 comments

The library is good, however the text visibility is poor even when zooming. Are you has a solution?

Brionne avatar Jul 19 '14 14:07 Brionne

Correction: On my phone (4.2 inches) the text is readable, but on my tablet (10.1 inches) the text is degraded. Would you know where it can come?

Brionne avatar Jul 19 '14 15:07 Brionne

Can you show me some screenshot so I can see what king of degradation you are talking about please?

JoanZapata avatar Jul 19 '14 21:07 JoanZapata

10.1 inches, degraded: 10 1 4.2 inches, correct: 4 2

Brionne avatar Jul 20 '14 10:07 Brionne

Thanks for the screenshot. Does that happen if you zoom in as well?

JoanZapata avatar Jul 20 '14 15:07 JoanZapata

Before and after zooming, the text is degraded. While zooming the text is almost readable (hard to tell). In contrast, with an advanced zoom the text is correct, it is not degraded.

Brionne avatar Jul 20 '14 18:07 Brionne

That's weird, I never encountered these kind of problems, and the lib was originally developed for tablets.

Can you send me your pdf file so I can test it? (Does it happen for other pdf files as well?)

JoanZapata avatar Jul 21 '14 07:07 JoanZapata

With any PDF, the text is degraded with only 10.1 inch tablet (Samsung Galaxy Tab 10.1). The problem is not related to pdf because by opening it in an external application, the text has no degradation.

Brionne avatar Jul 21 '14 10:07 Brionne

I developed the lib on galaxy tab 10.1, so it's really weird. I haven't tested since a long time though. I'll try to find some time to see what's wrong, but don't expect a fix anytime soon.

JoanZapata avatar Jul 21 '14 10:07 JoanZapata

Same for me... 7" Tablet and Text looks kind of broken.

Tried to enable antiAlising in the PDFView.java

    paint.setAntiAlias(true);
    canvas.drawBitmap(renderedBitmap, srcRect, dstRect, paint);

but did not change anything.

BigJenson avatar Aug 04 '14 14:08 BigJenson

UPDATE: I Fixed it :) this has done the trick:

paint.setAntiAlias(true); paint.setFilterBitmap(true); paint.setDither(true);

now the Text is rendered smoothly without looking broken.

BigJenson avatar Aug 04 '14 15:08 BigJenson

Nice, thanks for the tip! I'll try to get some time to test it and include it as a default.

JoanZapata avatar Aug 05 '14 09:08 JoanZapata

Do you have any news on this issue? We have the same issue when zooming. The text becomes unreadable.

janpieper avatar Jul 01 '15 09:07 janpieper

tempfileforshare 1

Yes ...The text become unreadable when you zoom... any solutions?

SOLUTION: Changing the GRID_SIZE to 10 in CONSTATS.java helped me solve the issue... Thank u Joan :)

rashidmoidu avatar Jul 05 '15 10:07 rashidmoidu

Quote: "UPDATE: I Fixed it :) this has done the trick:

paint.setAntiAlias(true); paint.setFilterBitmap(true); paint.setDither(true);

now the Text is rendered smoothly without looking broken."

How can I get "paint" object here?

umairvatao avatar Jul 21 '15 11:07 umairvatao

I'm having the same issue here, after some observation I realised that the library is always rendering the top right corner (in horizontal swipe). This area is perfectly rendered, but none of the others are. I tried to use the paint properties and have no sucess. Also the GRID_SIZE constant just render a bigger area, but don't solves the problem. I think there is a problem while calculating the zoomed area to be redered, but the minimap still showing the right one (the place i'm looking at). My device is a Galaxy S5 G900M. If I can help anyway please tell me. Thank you

cbcnos avatar Aug 23 '15 02:08 cbcnos

#145 should fix this issue KR

ghost avatar Aug 27 '15 08:08 ghost

Can someone tell me where to make those modifications?

paint.setAntiAlias(true); paint.setFilterBitmap(true); paint.setDither(true);

I have the latest pdfview source in my project but I still have the unreadable text problem sometimes.

Thanks @JoanZapata @BigJenson

yannickgagne avatar Oct 13 '15 18:10 yannickgagne

I have the same problem. I already tried to change the GRID_SIZE and change properties of paint object. Can someone help?

@yannickgagne the paint object is defined in the constructor of PDFView

IkkarionCross avatar Oct 15 '15 02:10 IkkarionCross

hi, i have read how to solve this issue. but i can't, how to add : paint.setAntiAlias(true); paint.setFilterBitmap(true); paint.setDither(true);

at PDFView.java

or change the GRID_SIZE to 10 in Constant.

maybe anyone can help me. thanks before

this my code..

public class ReaderActivity extends AppCompatActivity { PDFView pdfView;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_reader);

    File filesDir = getExternalFilesDir("pdf/tki.pdf");
    pdfView = (PDFView)findViewById(R.id.reader);

    pdfView.fromFile(filesDir)
            .defaultPage(1)
            .showMinimap(false)
            .enableSwipe(true)
            .load();

}

}

adhimafauzans avatar Mar 22 '16 11:03 adhimafauzans

@Shinthings read my last post. To change GRID_SIZE go to Constants.java the declaration is there.

IkkarionCross avatar Mar 22 '16 18:03 IkkarionCross

@IkkarionCross thanks for your response, ya how can i change the GRID_SIZE ? the file is locked / read only files. thats my problem

adhimafauzans avatar Mar 22 '16 19:03 adhimafauzans