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

Taking too long to show pdf with more number of pages

Open pradeep-orbi opened this issue 2 years ago • 6 comments

For some of the PDFs with 10 or more pages, it is taking too long to render the pdf. At least we should show the first page quickly, then on demand we can progressively load other pages when the user scrolls it.

pradeep-orbi avatar Jul 31 '21 03:07 pradeep-orbi

Current implementation does exactly that, we don't render all pages. What is "too long" in seconds? Sample app have more than 200 pages and loading within a second roughly. Isn't it the same for you?

Dmitry-Borodin avatar Aug 03 '21 08:08 Dmitry-Borodin

It is taking around 3-4 seconds to load just the first page of a PDF with 10 to 20 pages.

pradeep-orbi avatar Aug 04 '21 03:08 pradeep-orbi

@pradeep-orbi which performance do you see on sample with 200+ pages on the same device? It may not be related to amount of pages.

Dmitry-Borodin avatar Aug 04 '21 10:08 Dmitry-Borodin

I did not try the sample app. It is nothing to do with device. This issue was there in all the devices. The show() method is taking too long(3-4 seconds). Added loader until the show method returns.

This is one of the PDFs with which i have the issue https://www.orchardsoft.com/wp-content/uploads/2021/03/2018_orchardsoftware_pathology_reports.pdf

pradeep-orbi avatar Aug 04 '21 11:08 pradeep-orbi

I did not try the sample app. It is nothing to do with device. This issue was there in all the devices. The show() method is taking too long(3-4 seconds). Added loader until the show method returns.

This is one of the PDFs with which i have the issue https://www.orchardsoft.com/wp-content/uploads/2021/03/2018_orchardsoftware_pathology_reports.pdf

Which callback did you use to show and hide the loader?

miq0717 avatar Aug 29 '21 12:08 miq0717

@miq0717 showing the loader before calling pdf_view.fromFile(localPdfFile).show() method And hiding the loader in PDFRegionDecoder class. just before the decodeRegion() method returns a bitmap, i'm hiding the loader.

pradeep-orbi avatar Aug 31 '21 02:08 pradeep-orbi