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

TOPIC:

How to use hyperlinks 5 years 7 months ago #14092

  • radaee
  • radaee's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
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 5 years 7 months ago #14098

  • support
  • support's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 692
  • Thank you received: 59
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 5 years 7 months ago #14100

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

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

How to use hyperlinks 5 years 7 months ago #14108

  • support
  • support's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 692
  • Thank you received: 59
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 5 years 7 months ago #14110

  • radaee
  • radaee's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
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 5 years 7 months ago #14112

  • radaee
  • radaee's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
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.

  • Page:
  • 1
  • 2
Powered by Kunena Forum