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

TOPIC:

How to realize openning URL 9 years 8 months ago #6899

  • bodhixu
  • bodhixu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
how to realize to shift to the outside browser when you are tapping the text liking URL.

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

How to realize openning URL 9 years 8 months ago #6922

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

you have to handle it on OnOpenURI method in PDFReaderAct class.


Something like that:

public void OnOpenURI(String uri)
	{
		if(uri != null){
			Intent i = new Intent(Intent.ACTION_VIEW);
			i.setData(Uri.parse(uri));
			startActivity(i);
		}
	}



You can also check this:

www.androidpdf.mobi/forum/Android-develo...en-taping-on-it#6005

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

How to realize openning URL 9 years 8 months ago #6930

  • bodhixu
  • bodhixu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
thanks,

int dest = m_annot.GetDest();
if( dest >= 0 )
m_view.vGotoPage(dest);
String uri = m_annot.GetURI();
if( m_listener != null )
m_listener.OnOpenURI(uri);

but i want to kown how to instantiate the m_annot when tapping the pdf;

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

How to realize openning URL 9 years 8 months ago #6935

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

m_annot is instantiated in OnPDFSingleTapped method in PDFReader class:

m_annot = page.GetAnnotFromPoint(m_annot_pos.x, m_annot_pos.y);

If you want to open the url without using the "Do Button" of the Demo Project you can call the methods you need to open the URL in the OnPDFSingleTapped method.

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

How to realize openning URL 9 years 8 months ago #6939

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
in PDFReaderAct.OnAnnotClicked() (single tapped on the annotation shall fired this method under professional or premium license.)
just invoke m_view.PDFPerformAnnot();
then OnOpenURL shall invoked, if an URL annotation clicked.

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

Last edit: by .

How to realize openning URL 9 years 8 months ago #6955

  • bodhixu
  • bodhixu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Thank you very much, but I still have a few doubts.
1、
If I invoke the OnPDFSingleTapped(float x, float y),what is the parameter of x,y?
Is it the position on the screen?

2、
PDFReaderAct.OnAnnotClicked() is invoked automatically or manually call?
I'm standard license, is the PDFReaderAct.OnAnnotClicked() effective?

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum