• 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
PDFMarkupAnnotations not showing when drawing PDFPage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PDFMarkupAnnotations not showing when drawing PDFPage


  • Subject: PDFMarkupAnnotations not showing when drawing PDFPage
  • From: Antonio Nunes <email@hidden>
  • Date: Thu, 15 Feb 2007 00:24:19 +0000

Hi,

Last December this question came up on the list and John Calhoun answered, but we never knew if the OP was able to resolve his issue. Now I am up with the same issue. Trying to get markup annotations to draw and they won´t. I use the following test code:

PDFPage *page = [trackedObject pdfPage];
NSRect bounds = [page boundsForBox:kPDFDisplayBoxMediaBox];
PDFAnnotationMarkup *markup = [[[PDFAnnotationMarkup alloc] initWithBounds:bounds] autorelease];
[markup setMarkupType:kPDFMarkupTypeHighlight];
[page addAnnotation:markup];
[page setDisplaysAnnotations:YES];
[[currentDocument layoutView] setNeedsDisplay:YES];


For testing I want to encompass all text on the page so I sue the page's bound as the bounds for the annotation. Should work no? The view is not a PDFView (nor a subview of it) but that shouldn't make a difference, since according to documentation it is the page that draws the annotations.

Anyway, this is a sample dialog in the debugger:

Printing description of page:
Page 0; label = 1
  media (0.0, 0.0) [612.0, 792.0]
  crop (0.0, 0.0) [612.0, 792.0]
  rot 0
  ' \u25a0 \u201cShellScriptBasics\u201d(page11)...'

(gdb) po markup
Type: 'Highlight', Bounds: (0, 0) [612, 792]

(gdb) p (BOOL)[markup shouldDisplay]
$1 = 1 '\001'

(gdb) po [page annotations]
<NSCFArray 0xe3a2590>(
Type: 'Highlight', Bounds: (0, 0) [612, 792]

)

(gdb) po [markup quadrilateralPoints]
<NSCFArray 0xeb20350>(
<00000000 00000000 >,
<00001944 00000000 >,
<00001944 00004644 >,
<00000000 00004644 >
)


...so, as far as I can see, everything is set up correctly and the view is asked to redraw, which causes the PDFPage to be drawn. But no show. The page looks normal. No highlights. What am I overlooking?


-António

-----------------------------------------------------------
And you would accept the seasons of your
heart, even as you have always accepted
the seasons that pass over your field.

--Kahlil Gibran
-----------------------------------------------------------



_______________________________________________

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


  • Follow-Ups:
    • Re: PDFMarkupAnnotations not showing when drawing PDFPage
      • From: John Calhoun <email@hidden>
  • Prev by Date: Re: Newbie Q: Is it possible to draw functional "Cocoa Controls" in an OpenGL context?
  • Next by Date: Re: XML elements by attributes
  • Previous by thread: Re: Frustration trying to get NSConnection/NSPort working (feels like it should be simpler ...)
  • Next by thread: Re: PDFMarkupAnnotations not showing when drawing PDFPage
  • Index(es):
    • Date
    • Thread