- Posts: 13
- 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
Not Accurate of get Annotation
IP: 192.168.0.71
11 years 8 months ago #7038
by ex93nball
Not Accurate of get Annotation was created by ex93nball
I got this code to get Annot from page, but its not accurate with coordinate.
sometimes i got annot with that x,y coordinate on page 1 but when i scroll a half to page 2 and touch the annot its not recognise an annotation on page 2
- (void)OnSingleTapped:(float)x :(float)y :(NSString *)text{
struct PDFV_POS pos;
[m_view vGetPos:&pos];
PDFPage *page = [m_doc page:pos.pageno];
PDFAnnot *m_annot = [page annotAtPoint:x: y];
NSLog(@"tipe annot = %d, pageno = %d",m_annot.type,pos.pageno);
}
sometimes i got annot with that x,y coordinate on page 1 but when i scroll a half to page 2 and touch the annot its not recognise an annotation on page 2
- (void)OnSingleTapped:(float)x :(float)y :(NSString *)text{
struct PDFV_POS pos;
[m_view vGetPos:&pos];
PDFPage *page = [m_doc page:pos.pageno];
PDFAnnot *m_annot = [page annotAtPoint:x: y];
NSLog(@"tipe annot = %d, pageno = %d",m_annot.type,pos.pageno);
}
IP: 192.168.0.71
11 years 8 months ago #7043
by radaee
Replied by radaee on topic Not Accurate of get Annotation
PDFPage *page = [m_doc page:pos.pageno];
[page objsStart];
//...
[page objsStart];
//...
IP: 192.168.0.71
11 years 8 months ago #7044
by ex93nball
Replied by ex93nball on topic Not Accurate of get Annotation
I got this Error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PDFPage annotAtPoint:]: unrecognized selector sent to instance 0x7bac7b10'
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PDFPage annotAtPoint:]: unrecognized selector sent to instance 0x7bac7b10'
IP: 192.168.0.71
11 years 8 months ago - 11 years 8 months ago #7177
by Gracanin
Replied by Gracanin on topic Not Accurate of get Annotation
The following doesn't work, how do I select annotations that are already in the PDF
EDIT: It doesn't work in View Controller, but in PDFView.m it works fine.
Code:
-(void)OnSingleTapped:(float)x :(float)y :(NSString *)text
{
struct PDFV_POS pos;
[m_view vGetPos:&pos];
PDFPage *page = [m_doc page:pos.pageno];
[page objsStart];
PDFAnnot *annot = [page annotAtPoint:x :y];
if(annot)
{
PDF_RECT rect;
[annot getRect:&rect];
NSLog(@"%f %f %f %f", rect.left, rect.top, rect.right, rect.bottom);
}
}
EDIT: It doesn't work in View Controller, but in PDFView.m it works fine.
Last edit: 11 years 8 months ago by tutChetsRoodo. Reason: Found soultion
Time to create page: 0.480 seconds