AndroidPdfViewer icon indicating copy to clipboard operation
AndroidPdfViewer copied to clipboard

Changing device orientation from portrait to landscape render issue and does not keep current page number

Open simonbellu opened this issue 6 years ago • 6 comments

When the reader is open, if you rotate the device and change device orientation from portrait to landscape it sometimes does not render the page and the Scroll handle does not keep current page number but it jumps to another page number

simonbellu avatar Sep 25 '19 06:09 simonbellu

I'm facing this problem too.

bonyhardian avatar Feb 02 '20 15:02 bonyhardian

have same problem,any solutions?

EdwardTeach68 avatar Apr 22 '20 14:04 EdwardTeach68

HI, I solved but there is no universal way to fix this. Keep in mind that every time the device change orientation the activity restart and if this is not handled then it can led to issues. I finally opted for adding to the manifest.xml the configChanges parameter for the pdf activity. Read this https://androidresearch.wordpress.com/2013/05/10/dealing-with-asynctask-and-screen-orientation/ Or read the "Handle configuration changes" topic on Android Developers Site.

simonbellu avatar Apr 22 '20 15:04 simonbellu

Yeah, im using configChanges parameter and my activity does not restart, but still have problem when change orientation to landscape - my pdfView show middle of page or go to next page, have like scroll offset(can scroll to top). Sorry for bad english =)

EdwardTeach68 avatar Apr 22 '20 15:04 EdwardTeach68

Oh,i see when change orientation it focus on center of previous orientation,but how can i fix it )

EdwardTeach68 avatar Apr 22 '20 15:04 EdwardTeach68

There's an issue with offset calculations here. space-page1-space|space-page2-space|.... In this format, when I jump from one page to another, the current offset was being set to 0. Where it should be space. This is when I set the auto spacing to true. Any help with the calculations would be appreciated!?

sujithTSR avatar Mar 24 '22 08:03 sujithTSR