- Posts: 10
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about iOS development and PDF
how to get startIndex and endIndex of highlighted text in PDF
- joshnaAppcare
- Topic Author
- Offline
- New Member
-
Less
More
IP: 192.168.0.71
8 years 7 months ago #13433
by joshnaAppcare
Replied by joshnaAppcare on topic Get StartIndex and EndIndex of highlighted text
Hi,
Thanks for your reply
what will be the implementation of methods - (int)getStartIndex; and - (int)getEndIndex; in PDFVSel
Thanks for your reply
what will be the implementation of methods - (int)getStartIndex; and - (int)getEndIndex; in PDFVSel
IP: 192.168.0.71
8 years 7 months ago #13439
by federico
Replied by federico on topic Get StartIndex and EndIndex of highlighted text
Hi,
Regarding the methods getStartIndex and getEndIndex the implementation is what i said in the previous post.
Regarding the methods getStartIndex and getEndIndex the implementation is what i said in the previous post.
- joshnaAppcare
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 10
- Thank you received: 0
IP: 192.168.0.71
8 years 7 months ago #13441
by joshnaAppcare
Replied by joshnaAppcare on topic Get StartIndex and EndIndex of highlighted text
Hi,
yes but you told to implement in PDFVPage as below
If you want to get indexes you can add in PDFVPage class two methods:
- (int)GetSelStartIndex
{
return [m_sel getStartIndex];
}
- (int)GetSelEndIndex
{
return [m_sel getEndIndex];
}
but what should be the implementation in PDFVSel
yes but you told to implement in PDFVPage as below
If you want to get indexes you can add in PDFVPage class two methods:
- (int)GetSelStartIndex
{
return [m_sel getStartIndex];
}
- (int)GetSelEndIndex
{
return [m_sel getEndIndex];
}
but what should be the implementation in PDFVSel
IP: 192.168.0.71
8 years 7 months ago #13446
by federico
Replied by federico on topic Get StartIndex and EndIndex of highlighted text
Hi,
In PDFVPage class, you could add in PDFVSel implementation getStartIndex and getEndIndex methods:
In PDFVPage class, you could add in PDFVSel implementation getStartIndex and getEndIndex methods:
Code:
- (int)getStartIndex
{
return m_index1;
}
- (int)getEndIndex
{
return m_index2;
}
- joshnaAppcare
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 10
- Thank you received: 0
IP: 192.168.0.71
8 years 5 months ago #13719
by joshnaAppcare
Replied by joshnaAppcare on topic Get StartIndex and EndIndex of highlighted text
Hi,
But i am using pdfPage not using PDFVPage so how can i use these methods?
But i am using pdfPage not using PDFVPage so how can i use these methods?
IP: 192.168.0.71
8 years 5 months ago #13727
by emanuele
Replied by emanuele on topic Get StartIndex and EndIndex of highlighted text
Hi,
if you correctly implemented the code in previous posts, you will be able to get start and end index of the selection in OnSelTouchEnd method (PDFView class).
The current implementation get the selection's rect with [vpage GetSelRect], but you can use getStartIndex and getEndtIndex (explained in previous posts) to get indexes.
To get the PDFVPage instance of the selected text, you can use [m_view vGetPage:m_cur_page] as OnSelTouchEnd method already does.
If it could help. you can also edit the OnSelEnd delegate method and add start and end index of the selection, to retrieve these informations in RDPDFViewController.
You can add this code in OnSelTouchEnd implementation:
then edit OnSelEnd in this way:
- (void)OnSelEnd:(float)x1 :(float)y1 :(float)x2 :(float)y2 :(int)start :(int)end;
if you correctly implemented the code in previous posts, you will be able to get start and end index of the selection in OnSelTouchEnd method (PDFView class).
The current implementation get the selection's rect with [vpage GetSelRect], but you can use getStartIndex and getEndtIndex (explained in previous posts) to get indexes.
To get the PDFVPage instance of the selected text, you can use [m_view vGetPage:m_cur_page] as OnSelTouchEnd method already does.
If it could help. you can also edit the OnSelEnd delegate method and add start and end index of the selection, to retrieve these informations in RDPDFViewController.
You can add this code in OnSelTouchEnd implementation:
Code:
int start = [vpage GetSelStartIndex];
int end = [vpage GetSelEndIndex];
- (void)OnSelEnd:(float)x1 :(float)y1 :(float)x2 :(float)y2 :(int)start :(int)end;
Time to create page: 0.410 seconds