Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC:

Fit PDF to Screen in Landscape mode 9 years 5 months ago #7713

  • abhishekjaju
  • abhishekjaju's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 40
  • Thank you received: 1
Hello Sir,
I am makeing application tablet compatible I am opening PDF in Default def_view = 3;
Then PDF view fits to the center But,I want fit the PDF to the tablet screen How can I achieve it.

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

Fit PDF to Screen in Landscape mode 9 years 5 months ago #7714

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65

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

Fit PDF to Screen in Landscape mode 9 years 5 months ago #7717

  • abhishekjaju
  • abhishekjaju's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 40
  • Thank you received: 1
This is for vertical orientation.
I need to make it landscape or horizontal orientation.
I tried this code with landscape but the result is not the same.

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

Fit PDF to Screen in Landscape mode 9 years 5 months ago #7718

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
try to modify this:

if ((max_w > max_h || ((Activity) context).getResources()
.getConfiguration().orientation == ((Activity) context)
.getResources().getConfiguration().ORIENTATION_LANDSCAPE)
&& (max_w > w || ((Activity) context).getResources()
.getConfiguration().orientation == ((Activity) context)
.getResources().getConfiguration().ORIENTATION_LANDSCAPE))
m_view.vSetScale(0, 0, 0);
else
m_view.vSetScale((m_view.vGetMaxScale() / 2), 0, 0);// fit page

with this:

if ((max_w > max_h || getResources().getConfiguration().orientation == getResources().getConfiguration().ORIENTATION_PORTRAIT)
&& (max_w > w || getResources().getConfiguration().orientation == getResources().getConfiguration().ORIENTATION_PORTRAIT))
m_view.vSetScale(0, 0, 0);
else
m_view.vSetScale((m_view.vGetMaxScale() / 2), 0, 0);// fit page with correct scale

Then You have to find a way to set the correct scale in m_view.vSetScale of the else condition!

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

Last edit: by poudel.

Fit PDF to Screen in Landscape mode 9 years 5 months ago #7719

  • abhishekjaju
  • abhishekjaju's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 40
  • Thank you received: 1
Where do I modify this

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

Fit PDF to Screen in Landscape mode 9 years 5 months ago #7720

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
In onSizeChanged void of PdfReader class.
Once you have edited the onSizeChanged like here www.androidpdf.mobi/forum/Android-develo...screen?start=12#5023

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum