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

More
IP: 192.168.0.71 8 years 7 months ago #13433 by joshnaAppcare
Hi,
Thanks for your reply
what will be the implementation of methods - (int)getStartIndex; and - (int)getEndIndex; in PDFVSel
More
IP: 192.168.0.71 8 years 7 months ago #13439 by federico
Hi,
Regarding the methods getStartIndex and getEndIndex the implementation is what i said in the previous post.
More
IP: 192.168.0.71 8 years 7 months ago #13441 by joshnaAppcare
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
More
IP: 192.168.0.71 8 years 7 months ago #13446 by federico
Hi,
In PDFVPage class, you could add in PDFVSel implementation getStartIndex and getEndIndex methods:
Code:
- (int)getStartIndex { return m_index1; } - (int)getEndIndex { return m_index2; }
More
IP: 192.168.0.71 8 years 5 months ago #13719 by joshnaAppcare
Hi,
But i am using pdfPage not using PDFVPage so how can i use these methods?
More
IP: 192.168.0.71 8 years 5 months ago #13727 by emanuele
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:
Code:
int start = [vpage GetSelStartIndex]; int end = [vpage GetSelEndIndex];
then edit OnSelEnd in this way:
- (void)OnSelEnd:(float)x1 :(float)y1 :(float)x2 :(float)y2 :(int)start :(int)end;
Time to create page: 0.410 seconds
Powered by Kunena Forum