How to use hyperlinks - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Android development and PDF

TOPIC: How to use hyperlinks

How to use hyperlinks 2 weeks 6 days ago #14087

  • Evalarm
  • Evalarm's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Hi together, I got new license the Pro. Version, as there is the possibility to use hyperlinks I have now following question.

I have an PDF Dokument and I want to make a call on click a phone number, to write an mail by clicking mail address or just open an URL by clicking at an Uri.
How can I handle those click events?

Thanks for Help!
Regards, Leo

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

How to use hyperlinks 2 weeks 5 days ago #14092

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 842
  • Karma: 43
  • Thank you received: 12
if you are developing on android, there is a listener with callback method:
OnPDFAnnotTapped();
it implement on high level(PDFViewController class in Demo project).
in this method you can call m_view.PDFPerformAnnot(), this call will return callback:
OnPDFOpenURI();
this callback tells uri address user tapped.

and you can set customer uri on PDF Editor for some customer operation.

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

How to use hyperlinks 2 weeks 5 days ago #14097

  • Evalarm
  • Evalarm's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Yes I am developing on android.

The problem is that OnPDFAnnotTapped() is not called. Because its not an annotation.
Its a simple DPF file where phone numbers are listed.

I also run the PDFSample project and open the file, but no action on click at numbers or mail.
Example file is attached.
Attachments:

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

How to use hyperlinks 2 weeks 5 days ago #14098

  • support
  • support's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 551
  • Karma: 6
  • Thank you received: 43
You shall interact with document contents after a single or double tap:

In pseudo-code you shall:
i=ObjsGetCharIndex(tap_x, tap_y)
start=ObjsAlignWord(i, -1)
end=ObjsAlignWord(i, 1)
string=ObjsGetString(start,end)

Then you should apply a regex to string and evaluate if it's a proper URI syntax.

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

How to use hyperlinks 2 weeks 4 days ago #14099

  • Evalarm
  • Evalarm's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Thanks for quick reply!
But I got each time -1 as result, here my code:

@Override
public boolean OnPDFSingleTapped(float x, float y) {
Page pagee = m_doc.GetPage(0);
float[] tapp = {x, y};
int i = pagee.ObjsGetCharIndex(tapp); // i is allready -1 here
int start = pagee.ObjsAlignWord(i, -1);
int end = pagee.ObjsAlignWord(i, 1);
String result = pagee.ObjsGetString(start, end);

return false;
}

result is each time null

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

Last edit: by Evalarm.

How to use hyperlinks 2 weeks 4 days ago #14100

  • support
  • support's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 551
  • Karma: 6
  • Thank you received: 43
You shall add pagee.ObjsStart();
just after Page pagee = m_doc.GetPage(0);

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

Powered by Kunena Forum