Not Accurate of get Annotation - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about iOS development and PDF
  • Page:
  • 1

TOPIC: Not Accurate of get Annotation

Not Accurate of get Annotation 4 years 2 months ago #7038

  • ex93nball
  • ex93nball's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 0
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);
}

Please Log in or Create an account to join the conversation.

Not Accurate of get Annotation 4 years 2 months ago #7043

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 846
  • Karma: 43
  • Thank you received: 12
PDFPage *page = [m_doc page:pos.pageno];
[page objsStart];
//...

Please Log in or Create an account to join the conversation.

Not Accurate of get Annotation 4 years 2 months ago #7044

  • ex93nball
  • ex93nball's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 0
I got this Error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PDFPage annotAtPoint:]: unrecognized selector sent to instance 0x7bac7b10'

Please Log in or Create an account to join the conversation.

Not Accurate of get Annotation 4 years 2 months ago #7177

  • Gracanin
  • Gracanin's Avatar
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 25
  • Thank you received: 0
The following doesn't work, how do I select annotations that are already in the PDF
-(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.

Please Log in or Create an account to join the conversation.

Last edit: by tutChetsRoodo. Reason: Found soultion
  • Page:
  • 1
Powered by Kunena Forum