Re: Adding subviews to a PDFView
Re: Adding subviews to a PDFView
- Subject: Re: Adding subviews to a PDFView
- From: John Calhoun <email@hidden>
- Date: Wed, 14 Nov 2007 11:54:14 -0800
On Nov 11, 2007, at 11:42 AM, Antonio Nunes wrote:
I use a PDFView to show PDF documents. I need to add an NSTextView
as a subview of its documentView to provide editing capabilities
(and using an annotation text widget won't cut it unfortunately).
However, the view coordinates that convertRect:fromPage: provides
return coordinates relative to the PDFView itself, not to its
underlying documentView, so I know of no way to obtain the correct
offset for the target page.
You can convert from the page to the PDFView and vice versa using
PDFView methods. You can get the embedded documentView from PDFView.
The missing piece is the ol' -[NSView convertPointFrom/ToView:] methods.
In short, you need to do a double convert. page->PDFView and then
PDFView->documentView.
john calhoun—_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden