RadaeePDF.com :: Topic: Zoom level is not retained during rotation (1/1)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF

TOPIC: Zoom level is not retained during rotation

Zoom level is not retained during rotation 3 years 1 month ago #7420

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
The administrator has disabled public write access.

Zoom level is not retained during rotation 3 years 1 month ago #7430

  • nermeen
  • nermeen's Avatar
  • OFFLINE
  • Moderator
  • Posts: 709
  • Thank you received: 49
  • Karma: 18
First, it is not an issue...it is the default behavior...

You can change it, by modifying PDFReader.onSizeChanged
The administrator has disabled public write access.

Zoom level is not retained during rotation 3 years 1 month ago #7453

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
The administrator has disabled public write access.
Powered by Kunena Forum