- Posts: 69
- 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
PDF automatically zoom when I click button or link
- rachnasagar
- Topic Author
- Offline
- Senior Member
-
Less
More
IP: 192.168.0.71
8 years 8 months ago #12549
by rachnasagar
PDF automatically zoom when I click button or link was created by rachnasagar
When I am opening URI or Video the PDF automatically zoom . I am using this
For URI --
@Override
public void OnPDFOpenURI(String uri)
{
try
{
Intent intent = new Intent(Intent.ACTION_VIEW);
intent .setClass(this, ShowWebView.class);
intent .putExtra("Linkpass", uri);
startActivity(intent );
}
catch(Exception e)
{
//Toast.makeText(PDFViewAct.this, "todo: open url:" + uri, Toast.LENGTH_SHORT).show();
}
}
And this for Videos
public void OnPDFOpenMovie(String path)
{
//Toast.makeText(PDFViewAct.this, "todo: play movie", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, VideoPlayer.class);
intent.putExtra("VIDEOPATH", path);
startActivity(intent);
}
For URI --
@Override
public void OnPDFOpenURI(String uri)
{
try
{
Intent intent = new Intent(Intent.ACTION_VIEW);
intent .setClass(this, ShowWebView.class);
intent .putExtra("Linkpass", uri);
startActivity(intent );
}
catch(Exception e)
{
//Toast.makeText(PDFViewAct.this, "todo: open url:" + uri, Toast.LENGTH_SHORT).show();
}
}
And this for Videos
public void OnPDFOpenMovie(String path)
{
//Toast.makeText(PDFViewAct.this, "todo: play movie", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, VideoPlayer.class);
intent.putExtra("VIDEOPATH", path);
startActivity(intent);
}
IP: 192.168.0.71
8 years 8 months ago #12550
by Davide
Replied by Davide on topic PDF automatically zoom when I click button or link
Hi,
we can't reproduce the issue with the demo project. Can you?
If yes, can you please tell us the steps to reproduce it?
If no, can you please send us a sample project with that issue?
Thanks.
we can't reproduce the issue with the demo project. Can you?
If yes, can you please tell us the steps to reproduce it?
If no, can you please send us a sample project with that issue?
Thanks.
- rachnasagar
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 69
- Thank you received: 0
IP: 192.168.0.71
8 years 8 months ago - 8 years 8 months ago #12551
by rachnasagar
Replied by rachnasagar on topic PDF automatically zoom when I click button or link
I am sending you the video which is showing what
is happening
www.sendspace.com/file/f0dtbz
Plz download it and check
is happening
www.sendspace.com/file/f0dtbz
Plz download it and check
Last edit: 8 years 8 months ago by rachnasagar.
IP: 192.168.0.71
8 years 8 months ago #12552
by Davide
Replied by Davide on topic PDF automatically zoom when I click button or link
Hi,
I suggest you to do as in the demo project and modify PDFLayoutView.onSizeChanged as following:
I suggest you to do as in the demo project and modify PDFLayoutView.onSizeChanged as following:
Code:
@Override
protected void onSizeChanged( int w, int h, int oldw, int oldh )
{
super.onSizeChanged(w,h,oldw, oldh);
if(m_layout != null && m_status != STA_ANNOT && w > 0 && h > 0)
{
m_layout.vResize(w, h);
if( m_goto_pos != null )
{
m_pageno = m_goto_pos.pageno;
m_layout.vSetPos(0, 0, m_goto_pos);
m_goto_pos = null;
invalidate();
}
m_layout.vZoomSet(m_layout.vGetWidth()/2, m_layout.vGetHeight()/2, m_layout.vGetPos(0,0), 1);
PDFGotoPage(m_pageno);
}
}
Time to create page: 0.407 seconds