Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF
  • Page:
  • 1
  • 2

TOPIC:

How to get the x and y position when their is underline,highlight and strikeout 4 years 8 months ago #14455

  • apdeveloper
  • apdeveloper's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 67
  • Thank you received: 0
I want to get the position of x and y when underline,highlight and strikeout is done on pdf like when we click on annotation delegate method of did tap annot function is getting called and x and y position is getting log so similarly that x and y pos should get log when i start to select the text and do underline,highlight and strikeout.

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

How to get the x and y position when their is underline,highlight and strikeout 4 years 8 months ago #14457

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
Dear user:
you can get the position from PDFLayoutView.onTouchSelect(), follow the code line:
case MotionEvent.ACTION_UP:
start point:
m_hold_x
m_hold_y
end point:
event.getX();
event.getY();

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

Last edit: by radaee.

How to get the x and y position when their is underline,highlight and strikeout 4 years 8 months ago #14458

  • apdeveloper
  • apdeveloper's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 67
  • Thank you received: 0
How to call this variable or method from RDPDFviewcontroller :
start point:
m_hold_x
m_hold_y
end point:
event.getX();
event.getY();

and one more thing i am using the older version of Radaeepdf so can i call this function when selector is clicked
-(bool)OnSelTouchBegin:(CGPoint)point.

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

How to get the x and y position when their is underline,highlight and strikeout 4 years 8 months ago #14459

  • federico
  • federico's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 261
  • Thank you received: 18
Dear apdeveloper,
You could check OnSelEnd method in RDPDFViewController that will give you 4 coordinates. x1 and y1 are start selection's coordinates and x2 and y2 are end selection's coordinates.

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

Last edit: by federico.

How to get the x and y position when their is underline,highlight and strikeout 4 years 8 months ago #14464

  • apdeveloper
  • apdeveloper's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 67
  • Thank you received: 0
While adding the annot i am setting the name for the annot but still i am not getting the index of annot

-(void)vRemoveSelectorAnnot:(PDFAnnot *)annot
{
[self setReadOnly:false];
if (![self canSaveDocument]) {
[self vAnnotEnd];
NSLog(@"bbbbb---");
return;
}
m_status = sta_annot;
if( m_status != sta_annot ){
NSLog(@"aaaaa---");
return;
}
NSLog(@"Selected Page Annot NAme----%@",annot.getName);
[self setModified:YES force:NO];

//Action Stack Manger

PDFPage *page = [m_doc page:m_cur_page];
[actionManger push:ASDel alloc] initWithPage:m_cur_page page:page index:annot.getIndex;//Getting Error at this line while gtting index

[annot removeFromPage];
[self vAnnotEnd];
[m_view vRenderSync:m_cur_page];
[self refresh];
[m_doc save];
NSLog(@"Remove AnnotComplete---");
}

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

How to get the x and y position when their is underline,highlight and strikeout 4 years 8 months ago #14465

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,
in which case are you calling your vRemoveSelectorAnnot method?
You said "While adding the annot" but this code is removing the annotation.

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum