Zoom level is not retained during rotation - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Android development and PDF
  • Page:
  • 1

TOPIC: Zoom level is not retained during rotation

Zoom level is not retained during rotation 3 years 6 months ago #7420

  • abhishek28jain
  • abhishek28jain's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
Hi,

I am using PDF Library (2.9.6) on Android tablet device, i am getting an issue that zoom level (scale percentage) is not retained between Device orientation change (rotating device from landscape to portrait or reverse)

Steps:
- Open any PDF document, now zoom the PDF page with pinch gesture to say maximum zoom level
- Now rotate device from landscape -> portrait, you can observe that zoom level is changed to 0 (and appear as Best fit)

Expectation: Zoom level should be retain between device rotation changes

Please let me know how this issue can be resolved by modifying PDF View classes

Please note i have verified the same issue on latest version 3.0 of library, and same issue is coming.

Thanks,
Abhishek

Please Log in or Create an account to join the conversation.

Zoom level is not retained during rotation 3 years 6 months ago #7430

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 789
  • Karma: 20
  • Thank you received: 58
First, it is not an issue...it is the default behavior...

You can change it, by modifying PDFReader.onSizeChanged

Please Log in or Create an account to join the conversation.

Zoom level is not retained during rotation 3 years 6 months ago #7453

  • abhishek28jain
  • abhishek28jain's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
Agree that this could be default implementation that zoom need not retain between orientation change.

But when i try to implement this functionality by change onSizeChanged() method, and i have commented resetting zoom level changes to 0, so that it should retain zoom level between orientation change. After doing this Zoom/scale factor is retained. But then there are some side effect that i observe in My application after this change
- In some specific case when i am near last page of PDF (say 212 out of 216 pages) when i rotate sometime it jumps directly to last page (Please note this only happen when i try to retain zoom level meaning not setting scale value to 0 in onSizeChanged)

As per my observation scale values (scale, min scale and max scale) factor will vary dynamically between Landscape and Portrait mode based on available View size where we render PDF content. When i try to retain zoom factor then sometime m_scroller value is set to a value which is higher than right boundaries, so it directly jump to last page

Can you please suggest how can i control scroller calculation between orienation change when i try to retain zoom level.

Let me know if you want more detail regarding this issue

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum