How to use hyperlinks - Page 2 - RadaeePDF.com - Results from #6
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 2 days ago #14104

  • Evalarm
  • Evalarm's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Hi, the result is still null and i also again -1.

Current Code:
Page pagee = m_doc.GetPage(0); // m_annot_page.GetPageNo()
pagee.ObjsStart();
float[] tapp = {x,y};
int i = pagee.ObjsGetCharIndex(tapp);
int start = pagee.ObjsAlignWord(i, -1);
int end = pagee.ObjsAlignWord(i, 1);
String result = pagee.ObjsGetString(start, end);

Log.e("PDF", "" + result);
}

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

How to use hyperlinks 2 weeks 1 day ago #14108

  • support
  • support's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 551
  • Karma: 6
  • Thank you received: 43
I've a doubt about x, y in your code.
Which is the value you're loading in the variables?
Are you losing touch coordinates, isn't it?

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

How to use hyperlinks 2 weeks 1 day ago #14109

  • Evalarm
  • Evalarm's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
x and y are provided from OnPDFSingleTapped method.
Yes this are the touch coordinates, I also try it with following code.
This provide other coordinates.
Both of them not work

@Override
public boolean OnPDFSingleTapped(float x, float y) {
m_annot_pos = m_view.vGetPos((int) x, (int) y);
m_annot_page = m_view.vGetPage(m_annot_pos.pageno);
Page pagee = m_doc.GetPage(m_annot_page.GetPageNo());
pagee.ObjsStart();
float[] tapp = {x, y};
int i = pagee.ObjsGetCharIndex(tapp);
int start = pagee.ObjsAlignWord(i, -1);
int end = pagee.ObjsAlignWord(i, 1);
String result = pagee.ObjsGetString(start, end);

LogWrapper.e("PDF", "" + result);
}
return false;
}

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

How to use hyperlinks 2 weeks 1 day ago #14110

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 842
  • Karma: 43
  • Thank you received: 12
i tested following codes, and it works:
m_annot_pos = m_layout.vGetPos((int) event.getX(), (int) event.getY());
m_annot_page = m_layout.vGetPage(m_annot_pos.pageno);
Page page = m_doc.GetPage(m_annot_page.GetPageNo());
page.ObjsStart();
int ichar = page.ObjsGetCharIndex(new float[]{m_annot_pos.x, m_annot_pos.y});
int start = page.ObjsAlignWord(ichar, -1);
int end = page.ObjsAlignWord(ichar, 1);
String result = page.ObjsGetString(start, end);
Log.e("TAP", result + " " + ichar + " " + start + " " + end);

if not work yet. it maybe following issue:
1.you have not active any license, even demo license.
2.the PDF page is pure image page, the text is pixel image, not fonts.

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

Last edit: by radaee.

How to use hyperlinks 2 weeks 1 day ago #14111

  • Evalarm
  • Evalarm's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Still not working for me, following result I got for all testet documents:
E/TAP: null -1 -1 -1

Could you attach your pdf file with which is working.
I testet ist with demo license with watermark from radeepdf and also with our pro. Version.

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

How to use hyperlinks 2 weeks 1 day ago #14112

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 842
  • Karma: 43
  • Thank you received: 12
if red watermark displayed on page, it mean, you have not actived demo license.
this mostly because you have changed package name.

if blue watermark displayed, i think your PDF file is pure image page.

the attachment is the PDF file i test, acturally, it works on every PDF file.
Attachments:
The following user(s) said Thank You: Evalarm

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

Powered by Kunena Forum