Re: PDFAnnotationLine problem
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