Re: Saving a PDF Selection or converting it to an NSRange and back
Re: Saving a PDF Selection or converting it to an NSRange and back
- Subject: Re: Saving a PDF Selection or converting it to an NSRange and back
- From: John Calhoun <email@hidden>
- Date: Wed, 11 Feb 2009 13:03:37 -0800
On Feb 11, 2009, at 12:44 PM, Keith Blount wrote:
The subject line says it all, really, I need to save a PDFSelection
between sessions in my program, but there seems no way of doing
this. A similar question came up on these last year but there was no
solution:
To save a selection sapnning multiple pages you could convert a single
selection into an array of single-line selections (-[PDFSelection
selectionsByLine]). Each selection returned by this method is going
to be on a single page (and a single contiguous range and line). The
bounds then of these selections can be saved and then the selections
recreated from those bounds.
I haven't tried the above but it should work in principle.
PDFSelection should probably expose some method of archiving in the
future....
Of course, if there is a better way of implementing PDF highlighting
that I'm missing, please feel free to tell me point me in the
direction of what I have overlooked. I have looked at the docs, the
samples and searched the net before posting, though.
No better, but different: you could take the bounds returned from the
above discussion and instead create Highlight annotations. These you
can add to the PDF and save out. Might save you some work since when
re-opening the PDF you don't need to re-create the highlights since
they're now embedded in the PDF.
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