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 3 months ago #13166 by joshnaAppcare
hi, how can i get startIndex and endIndex of highlighted text so that i can store in data base and again show the highlighted text in swift...
can any one suggest to get the start point and end point in page..
Thankyou.
More
IP: 192.168.0.71 8 years 1 month ago #13397 by josgou
hi i want to store in my database start and end index of highlighted text so that i want to recreate the highlight..

public func onSelEnd(_ x1: Float, _ y1: Float, _ x2: Float, _ y2: Float) {
posx1 = Int(x1)
posy1 = Int(y1)
posx2 = Int(x2)
posy2 = Int(y2)

let m_scale = UIScreen.main.scale

let startIndex = pdfPage.objsGetCharIndex(Float(posx1 * Int(m_scale)), Float(posy1 * Int(m_scale)))
let endIndex = pdfPage.objsGetCharIndex(Float(posx2/Int(m_scale)), Float(posy2/Int(m_scale)))

but aim getting different location in pdf highlight can any one help me
More
IP: 192.168.0.71 8 years 1 month ago #13398 by joshnaAppcare
public func onSelEnd(_ x1: Float, _ y1: Float, _ x2: Float, _ y2: Float) {
posx1 = Int(x1)
posy1 = Int(y1)
posx2 = Int(x2)
posy2 = Int(y2)

let m_scale = UIScreen.main.scale
let startIndex = pdfPage.objsGetCharIndex(Float(posx1 * Int(m_scale)), Float(posy1 * Int(m_scale)))
let endIndex = pdfPage.objsGetCharIndex(Float(posx2/Int(m_scale)), Float(posy2/Int(m_scale)))

but aim getting different location in pdf highlight can any one help me
More
IP: 192.168.0.71 8 years 1 month ago #13400 by federico
Hi,
I suggest you to take a look in PDFView class at the OnSelTouchEnd method:
Code:
PDF_RECT rect = [vpage GetSelRect];
This method get the rect of the selected text in pdf's coordinates.
If you want to get indexes you can add in PDFVPage class two methods:
Code:
- (int)GetSelStartIndex { return [m_sel getStartIndex]; } - (int)GetSelEndIndex { return [m_sel getEndIndex]; }
And when you want to reuse them just call the method addAnnotMarkup and passing indexes
More
IP: 192.168.0.71 8 years 1 month ago #13415 by joshnaAppcare
hi,
I have place these two methods in PDFVPage but its showing as "No visible @interface for 'PDFVSel' declares the selector 'getStartIndex'" and No visible @interface for 'PDFVSel' declares the selector 'getEndIndex'
More
IP: 192.168.0.71 8 years 1 month ago #13418 by federico
Hi,
Try to add this code PDFVPage.h in the PDFVSel inferface:
Code:
@interface PDFVSel : NSObject //some other code - (int)getStartIndex; - (int)getEndIndex; @end
and so these methods will be visible to others classes.
Time to create page: 0.430 seconds
Powered by Kunena Forum