- Posts: 1123
- Thank you received: 73
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
How to use hyperlinks
IP: 111.196.245.2
7 years 7 months ago #14092
by radaee
How to use hyperlinks was created by radaee
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.
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.
IP: 37.183.44.177
7 years 7 months ago #14098
by support
Replied by support on topic How to use hyperlinks
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.
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.
IP: 37.183.44.177
7 years 7 months ago #14100
by support
Replied by support on topic How to use hyperlinks
You shall add pagee.ObjsStart();
just after Page pagee = m_doc.GetPage(0);
just after Page pagee = m_doc.GetPage(0);
IP: 37.183.44.177
7 years 6 months ago #14108
by support
Replied by support on topic How to use hyperlinks
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?
Which is the value you're loading in the variables?
Are you losing touch coordinates, isn't it?
IP: 111.196.240.57
7 years 6 months ago - 7 years 6 months ago #14110
by radaee
Replied by radaee on topic How to use hyperlinks
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.
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.
Last edit: 7 years 6 months ago by radaee.
IP: 111.196.240.57
7 years 6 months ago #14112
by radaee
Replied by radaee on topic How to use hyperlinks
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.
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.
Time to create page: 0.378 seconds