returning to first page when orientation change - 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
  • 2

TOPIC: returning to first page when orientation change

returning to first page when orientation change 4 years 1 month ago #7232

  • admin
  • admin's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
Hello,
I've noticed Radaee doesn't remember the current page when the orientation change.
So when I change from portrain to landscape I am getting the first page of pdf.
Demo Radaee doesn't provide solution for that.
How can I solve this problem? :side:

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

Last edit: by vishwakarmaspot.

change page to another page 4 years 1 month ago #7249

  • admin
  • admin's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
solved :lol:

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

Last edit: by vishwakarmaspot.

change page to another page 4 years 1 month ago #7316

  • dkastner
  • dkastner's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 11
  • Thank you received: 0
How do you fixed it?


Cheers,
Daniel

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

change page to another page 4 years 1 month ago #7320

  • admin
  • admin's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
I added one snipet to source (demo) code and changed manifest file to handle configchanges:

In ReaderController:

protected void onSizeChanged(int w, int h, int oldw, int oldh) {
m_save_w = w;
m_save_h = h;
if (m_pdv != null && !m_lock_resize)
m_pdv.vResize(w, h);

//added this part
if (m_pdv == null) return;
PDFView.PDFPos pos = m_pdv.vGetPos(0, 0);
m_pdv.vResize(w, h);
m_pdv.vSetScale(0, 0, 0);
if (m_cur_page >= 0) {
m_pdv.vGotoPage(m_cur_page);
} else if (pos != null) {
m_pdv.vSetPos(pos, 0, 0);
m_pdv.vCenterPage(pos.pageno);
}
}

And in manifes.xm for activity displaying pdf I added:

android:configChanges="orientation|screenSize"

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

Last edit: by vishwakarmaspot.

change page to another page 4 years 1 month ago #7352

  • dkastner
  • dkastner's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 11
  • Thank you received: 0
Hey admin,

thanks for sharing your solution. Unfortunately it doesn't work for me. Or better say it works only partial. If I start in Landscape displaying page 2 of the PDF ad switch to Porttrait it's showing half of page one and half of page 2. When I swicth back to Landscape it shows again page two, but with a slight offset to the right (page is not centered on screen). Do you have the same behavior or does it work like a charm for you?


Thanks again,

Daniel

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

change page to another page 4 years 1 month ago #7359

  • admin
  • admin's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
it means you are doing it wrong :) Catch the zip project and test it!

This project is simple project demo. It handles two pages when landscape mode and one when portrait. If you see two pages 2&3 and you change to portrait, you will see only 2.

www34.zippyshare.com/v/71793623/file.html

Write back asap if it is working.
The following user(s) said Thank You: Patel

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

Last edit: by vishwakarmaspot.
  • Page:
  • 1
  • 2
Powered by Kunena Forum