RadaeePDF.com :: Topic: Fit PDF to Screen in Landscape mode (1/2)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC: Fit PDF to Screen in Landscape mode

Fit PDF to Screen in Landscape mode 2 years 8 months ago #7713

  • abhishekjaju
  • abhishekjaju's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Thank you received: 1
  • Karma: 0
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.
The administrator has disabled public write access.

Fit PDF to Screen in Landscape mode 2 years 8 months ago #7714

  • Davide
  • Davide's Avatar
  • OFFLINE
  • Moderator
  • Posts: 663
  • Thank you received: 43
  • Karma: 12
The administrator has disabled public write access.

Fit PDF to Screen in Landscape mode 2 years 8 months ago #7717

  • abhishekjaju
  • abhishekjaju's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Thank you received: 1
  • Karma: 0
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.
The administrator has disabled public write access.

Fit PDF to Screen in Landscape mode 2 years 8 months ago #7718

  • Davide
  • Davide's Avatar
  • OFFLINE
  • Moderator
  • Posts: 663
  • Thank you received: 43
  • Karma: 12
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!
Last Edit: 2 years 8 months ago by poudel.
The administrator has disabled public write access.

Fit PDF to Screen in Landscape mode 2 years 8 months ago #7719

  • abhishekjaju
  • abhishekjaju's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Thank you received: 1
  • Karma: 0
Where do I modify this
The administrator has disabled public write access.

Fit PDF to Screen in Landscape mode 2 years 8 months ago #7720

  • Davide
  • Davide's Avatar
  • OFFLINE
  • Moderator
  • Posts: 663
  • Thank you received: 43
  • Karma: 12
In onSizeChanged void of PdfReader class.
Once you have edited the onSizeChanged like here www.androidpdf.mobi/forum/Android-develo...screen?start=12#5023
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Powered by Kunena Forum