• 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: Creating a PDFSelection...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a PDFSelection...


  • Subject: Re: Creating a PDFSelection...
  • From: John Calhoun <email@hidden>
  • Date: Wed, 26 May 2010 11:50:16 -0700

On May 25, 2010, at 9:37 PM, Matthew Weinstein wrote:
> Actually, I don't need the tiff; I just need the rectangle! People have to be able to sketch the rectangle over the pdf, and then my program stores and restores those rectangles (with some additional information).

PDFSelection has a routine to return each line from the selection as a sub-selection (for a single word selection this generally is just the selection itself, but for selections that span multiple lines you get a new selection for each line).

For each "line selection" you can get its bounds. These you can store/archive along with the page index.

With the archived rectangles and page indices you can later create selections again from those rectangles (PDFPage has -[selectionForRect:]).

This isn't a perfect solution though — you may have to pad out the rectangle a bit for example to improve fidelity between the original selection and the unarchived one.

If you know the range of the original text selected, PDFPage's -[selectionForRange:] is unambiguously specified.

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

References: 
 >Creating a PDFSelection... (From: Matthew Weinstein <email@hidden>)
 >Re: Creating a PDFSelection... (From: Matthew Weinstein <email@hidden>)
 >Re: Creating a PDFSelection... (From: Matthew Weinstein <email@hidden>)

  • Prev by Date: initializing a pdfview
  • Next by Date: Re: initializing a pdfview
  • Previous by thread: Re: Creating a PDFSelection...
  • Next by thread: Crash trying to unarchive webview from IB document
  • Index(es):
    • Date
    • Thread