• 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
adding PDF annotations to the output of a regular NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

adding PDF annotations to the output of a regular NSView


  • Subject: adding PDF annotations to the output of a regular NSView
  • From: Martin Wierschin <email@hidden>
  • Date: Wed, 29 Jul 2009 16:44:07 -0700

Hello Everyone,

I have a regular NSView hierarchy that saves out to PDF just fine. It's wonderful that the drawing/printing system on OSX is unified the way it is.

Here's the addition: I'd like to link parts of my NSViews together, eg: if the user opens the saved PDF in Preview.app, clicking in some special region will take them to another part of the same PDF. It looks like PDFKit has exactly something for this, PDFAnnotationLink. Unfortunately one can only apply such an object in the context of a PDFPage/PDFView.

So the problem is that there doesn't seem to be any way of marrying these two systems together. Ideally there would be some Cocoa method I could call in my NSView's drawRect method to add PDF annotations. But the only solution I see is something like this:

1. Produce raw PDF data from my normal NSView hierarchy.
2. Load that NSView data into a PDFView.
3. Add PDFAnnotations to special regions as desired.
4. Resave the modified PDF data from the PDFView.

This seems very inefficient and error prone (eg: mapping coordinates between NSView and PDF page space). Is this really the best option available? Thanks for any sanity checks on this.

Cheers,
~Martin

_______________________________________________

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 PDF annotations to the output of a regular NSView
      • From: John Calhoun <email@hidden>
  • Prev by Date: [moderator] Re: [moderator] Re: About Posting [ end of this thread ]
  • Next by Date: [NSEvent data1]
  • Previous by thread: Looking for a method to Lock and Unlock the computer
  • Next by thread: Re: adding PDF annotations to the output of a regular NSView
  • Index(es):
    • Date
    • Thread