DImuthuUpe / AndroidPdfViewer

Android view for displaying PDFs rendered with PdfiumAndroid
Apache License 2.0
8.16k stars 1.91k forks source link

High resolution rendering of multi-page PDF with swipeHorizontal enabled #591

Open Doctrevil opened 6 years ago

Doctrevil commented 6 years ago

In one of my tests, i have a multiple page PDF i am attempting to render with swipeHorizontal enabled (allowing for horizontal view of pages, side by side). When I am fully zoomed out (1) there is no problem, the quality is maintained between all visible content. However, when I zoom in (the issue occurs less at 1.75, and frequently at 3), the quality of all visible regions on the screen is not consistent. Some regions appear to be processed at the user's current zoom, while others are still processed without zoom (1). At times, slight movement causes the entire visible region to render without zoom (1). Is anyone else having this problem? (My test cases are just using double-tap for zoom, so DEFAULT_MIN_SCALE, DEFAULT_MID_SCALE, DEFAULT_MAX_SCALE)

ghost commented 6 years ago

Yes. Zooming creates many smaller segments and when you zoom out it keeps them. So eventually you run out of segments you are able to render and it removes the oldest ones. You then see the thumbnail mode behind the full renders.

Enable debug mode of your want to visualise the problem. My current hack fix is to empty the cache when it fills up and it makes all new grids that are much neater but it's not efficient.

lalepsis commented 6 years ago

Hi SlinkyRaptor, and how exactly did you implemented this hack?