• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Adding subviews to a PDFView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Adding subviews to a PDFView
      • From: Antonio Nunes <email@hidden>
References: 
 >Adding subviews to a PDFView (From: Antonio Nunes <email@hidden>)

  • Prev by Date: Re: NSToolbarItem tooltip delay
  • Next by Date: Re: Subclassing best practice
  • Previous by thread: Adding subviews to a PDFView
  • Next by thread: Re: Adding subviews to a PDFView
  • Index(es):
    • Date
    • Thread