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

Fit PDF to Screen in Landscape mode

More
IP: 192.168.0.71 11 years 2 months ago #7713 by abhishekjaju
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.
More
More
IP: 192.168.0.71 11 years 2 months ago #7717 by abhishekjaju
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.
More
IP: 192.168.0.156 11 years 2 months ago - 11 years 2 months ago #7718 by Davide
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: 11 years 2 months ago by poudel.
More
IP: 192.168.0.71 11 years 2 months ago #7719 by abhishekjaju
Where do I modify this
More
IP: 192.168.0.156 11 years 2 months ago #7720 by Davide
In onSizeChanged void of PdfReader class.
Once you have edited the onSizeChanged like here www.androidpdf.mobi/forum/Android-develo...screen?start=12#5023
Time to create page: 0.422 seconds
Powered by Kunena Forum