PDFKit: translate point coordinates from view coordinates into page coordinates

2012-03-27 Thread Nick
Hello I would like to place a PDFAnnotation onto a PDF page in a place where the user clicked with the mouse. Position for PDFAnnotations is specified using page coordinates. Mouse position - using global coordinates, which can be translated into PDFView coordinates. However, I can't figure out

Re: PDFKit: translate point coordinates from view coordinates into page coordinates

2012-03-27 Thread Alvaro Costa Neto
Hey Nick, how are you? Try to use the PDFView's convertPoint/Rect:to/fromPage: methods http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/QuartzFramework/Classes/PDFView_Class/Reference/Reference.html. The trick is to always remember to use a common ground (the

Re: PDFKit: translate point coordinates from view coordinates into page coordinates

2012-03-27 Thread Nick
Hi Alvaro Thank you for the response! Yes, this is it. I just found a sample code PDFKitLinker2, and it showed how to do just what i need. 27 марта 2012 г. 15:05 пользователь Alvaro Costa Neto nepheus...@gmail.com написал: Hey Nick, how are you? Try to use the PDFView's

Re: PDFKit: translate point coordinates from view coordinates into page coordinates

2012-03-27 Thread Antonio Nunes
On 27 Mar 2012, at 12:19, Nick wrote: I would like to place a PDFAnnotation onto a PDF page in a place where the user clicked with the mouse. [...] NSPoint locationInView = [self convertPoint:[theEvent locationInWindow] fromView:[[self window] contentView]]; You are receiving the event