PDFMarkupAnnotations!?
PDFMarkupAnnotations!?
- Subject: PDFMarkupAnnotations!?
- From: Alexander Griekspoor <email@hidden>
- Date: Thu, 14 Dec 2006 14:54:08 +0000
Hi,
I'm trying to add a PDFMarkupAnnotation, markuptype Highlight to my
pdf, but can someone tell me how to do it, because I don't get it.
Here's what I have thusfar, trying to highlight all the instances of
the word "help":
PDFSelection *hit = nil;
NSEnumerator *hits = [[[pdfview document] findString: @"help"
withOptions: NSLiteralSearch]objectEnumerator];
while(hit = [hits nextObject]){
// Get bounds (page space) for selection (first page in case
selection spans multiple pages).
PDFPage *page = [[hit pages] objectAtIndex: 0];
NSRect bounds = [hit boundsForPage: page];
PDFAnnotationMarkup *markup = [[PDFAnnotationMarkup alloc]
initWithBounds: bounds];
[markup setMarkupType: kPDFMarkupTypeUnderline];
[page addAnnotation: markup];
[markup release];
}
Nothing shows up though. The same code with a PDFSquareAnnotation
works fine, but is not what I would like to do unfortunately.
Now, the documents show this method:
setQuadrilateralPoints:
Sets the array of quadrilateral points defining the bounds of the
markup.
- (void)setQuadrilateralPoints:(NSArray *)points
Discussion
The points defined by each quadrilateral array should encompass a
word or a contiguous group of words. The quadrilateral points are
ordered counterclockwise, with the first point closest to the origin
in page space.
Page space is a 72 dpi coordinate system with the origin at the lower-
left corner of the current page.
Besides the terminology, what the f*? How can I make an NSArray of
points? Certainly not NSPoints, these are not objects?!
Do I miss something here, and why can I just add a highlight
annotation by feeding it a PDFSelection? That would seem logical
wouldn't it?
Many thanks for your help,
Alex
***********************************
Mek (Alexander Griekspoor)
MekenTosj.com
Web: http://www.mekentosj.com
Mail: email@hidden
***********************************
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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