- Posts: 2
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Zoom level is not retained during rotation
- abhishek28jain
- Topic Author
- Offline
- New Member
-
Less
More
IP: 192.168.0.71
11 years 5 months ago #7420
by abhishek28jain
Zoom level is not retained during rotation was created by abhishek28jain
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
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
IP: 192.168.0.158
11 years 5 months ago #7430
by nermeen
Replied by nermeen on topic Zoom level is not retained during rotation
First, it is not an issue...it is the default behavior...
You can change it, by modifying PDFReader.onSizeChanged
You can change it, by modifying PDFReader.onSizeChanged
- abhishek28jain
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
IP: 192.168.0.71
11 years 5 months ago #7453
by abhishek28jain
Replied by abhishek28jain on topic Zoom level is not retained during rotation
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
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
Time to create page: 0.386 seconds