• 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: PDFAnnotationLine problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PDFAnnotationLine problem


  • Subject: Re: PDFAnnotationLine problem
  • From: John Calhoun <email@hidden>
  • Date: Mon, 4 Feb 2008 18:59:22 -0800

So, this is a little convoluted to explain, but I'll try....

You're right that the -[initWithBounds:] method for Square allocates and assigns a default PDFBorder object while the Line annotation does not. For being asymmetrical, this is a bug. You can workaround this with a call like:

	[myLine setBorder: [[PDFBorder alloc] init]];

....right after your call to create the Line annotation.

I see the same asymmetry bug in Leopard as well, but it looks like it should be less problematic because the drawing code for PDFLine, handles the case with no border (it assumes a line width of 1 point). And I'm fairly sure that a Line annotation (or for that matter a Circle or Square) without a border is a perfectly legitimate and legal annotation (and you assume then line width of 1 point, solid, not dashed line, etc.).

In other words, a PDFLine with no border is okay on Leopard — perhaps does not draw though on Tiger.

So, I'm sort of wondering out loud if PDFKit ought to be "pre- populating" your new Line and Square objects with a PDFBorder at all.

I'm afraid to change it now because apps may assume - [mySquareAnnotation border] to return a non-NULL value (when, for example, they want to specify a different line width).

Perhaps though PDFLine ought to fix the asymmetry problem by adding the PDFBorder for you at creation time. The cleverness can be when PDFKit writes out the annotations to a file ... if the PDFBorder has a width of 1 and is solid, we drop border tag on output. This seems like a safe strategy.....

So, in short, yes, bug. Add the line of code above and everything should be happy.

John Calhoun—

On Feb 4, 2008, at 1:59 PM, Vince wrote:
I am trying to create annotations for pdf files using the PDFAnnotation routines.
PDFAnnotationSquare, PDFAnnotationCircle, and PDFAnnotationLink work fine.
But I am having problems with PDFAnnotationLine - regarding both the placement of the line as well as the lines thickness and style.
_______________________________________________

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: PDFAnnotationLine problem
      • From: John Calhoun <email@hidden>
References: 
 >PDFAnnotationLine problem (From: Vince <email@hidden>)

  • Prev by Date: Re: Use of Mac OS X 10.5 / Leopards Garbage Collection Considered Harmful
  • Next by Date: Re: PDFAnnotationLine problem
  • Previous by thread: Re: PDFAnnotationLine problem
  • Next by thread: Re: PDFAnnotationLine problem
  • Index(es):
    • Date
    • Thread