DImuthuUpe / AndroidPdfViewer

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

Wrong page numbering in landscape mode #141

Open JulienRaad opened 8 years ago

JulienRaad commented 8 years ago

Hello, First thank you for this good library !

I have found an issue while using your library. When in portrait mode the side number indicating the current page is correct. However, in the landscape mode, page number at the side is not accurate. Through scrolling, the error increase.

Thank you

barteksc commented 8 years ago

Ok, I will look at this problem

barteksc commented 8 years ago

I cannot reproduce this bug, please provide more info and problematic pdf document

Quentin1010 commented 7 years ago

Just tested it and I got the issue too. On a 7 pages PDF, I ended up at 5/7 on the ScrollHandler. Though I didn't got the time to investigate more, just to let you know :/

kmraun commented 7 years ago

I have same issue, while scrolling the page, getting page number is wrong even i have used onPageChangeListener implementation. Please help me.

Pdfview is loading of inside the Fragment.

getActivity().runOnUiThread(new Runnable() {
            public void run() {
                pdfView.fromBytes(bytes)
                        .defaultPage(0)
                        .onPageChange(onPageChangeListener)
                        .onLoad(new OnLoadCompleteListener() {
                            @Override
                            public void loadComplete(int nbPages) {
                                System.out.println("loadComplete Listener ->"+nbPages);
                            }
                        })
                        .scrollHandle(new PDFScrollHandler(context)).load();
            }
        });