| Inherits from | |
| Conforms to | |
| Framework | Library/Frameworks/Quartz.framework/Frameworks/PDFKit.framework |
| Availability | Available in Mac OS X v10.4 and later.
|
| Declared in | PDFAnnotation.h |
PDFAnnotation, a subclass of NSObject, represents an annotation in a PDF document, which associates an object (such as a note or a sound) with a location in a PDF document.
In addition to its primary textual content, a PDF file can contain annotations that represent links, form elements, highlighting circles, textual notes, and so on. Each annotation is associated with a specific location on a page and may offer interactivity with the user. See the Adobe PDF Specification for more on annotations.
You are not likely to work with a PDFAnnotation object by itself, because the specific subclasses, such as PDFAnnotationCircle, are much more useful. When a PDF file is being parsed, however, any unknown or unsupported annotation is represented as a PDFAnnotation object.
PDFAnnotation is an abstract superclass of the following concrete classes:
PDFAnnotationButtonWidget
PDFAnnotationCircle
PDFAnnotationFreeText
PDFAnnotationInk
PDFAnnotationLine
PDFAnnotationLink
PDFAnnotationMarkup
PDFAnnotationPopup
PDFAnnotationSquare
PDFAnnotationStamp
PDFAnnotationText
PDFAnnotationTextWidget
– page
– modificationDate
– setModificationDate
– userName
– setUserName
– popup
– setPopup
– mouseUpAction
– setMouseUpAction
– type
– contents
– setContents:
– toolTip
Returns the border style for the annotation.
- (PDFBorder *)border
The border style for the annotation. See “Constants” in the PDFBorder class for possible values.
PDFAnnotation.hReturns the bounding box for the annotation in page space.
- (NSRect)bounds
The bounding box for the annotation in page space.
Page space is a 72-dpi coordinate system with the origin at the lower-left corner of the current page.
PDFAnnotation.hReturns the stroke color for the annotation.
- (NSColor *)color
The stroke color for the annotation.
Where this color is used depends on the type of annotation.
PDFAnnotation.hReturns the textual content (if any) associated with the annotation.
- (NSString *)contents
A string representing the textual content associated with the annotation.
Textual content is typically associated with PDFAnnotationText and PDFAnnotationFreeText annotations.
PDFAnnotation.hDraws the annotation on its associated page.
- (void)drawWithBox:(PDFDisplayBox)box
The bounding box used to draw the annotation in.
The annotation is drawn relative to the origin of box in page space.
Page space is a 72 dpi coordinate system with the origin at the lower-left corner of the current page.
For additional information see the “Constants” section in the PDFPage class.
PDFAnnotation.hReturns a Boolean value that indicates whether the annotation has an appearance stream associated with it.
- (BOOL) hasAppearanceStream
YES if the annotation has an appearance stream; otherwise NO.
An appearance stream is a sequence of draw instructions used to render a PDF item. If an appearance stream exists, PDF Kit draws the annotation using the stream, which may override existing set parameters (such as the stroke color set with setColor).
PDFAnnotation.hInitializes a PDF annotation object.
- (id)initWithBounds:(NSRect)bounds
The bounding box of the annotation, in page space.
An initialized PDFAnnotation instance, or NULL if the object could not be initialized.
Subclasses of PDFAnnotation should use this method to initialize annotation instances. Provide bounds in page space. Invoking initWithBounds: directly on a PDFAnnotation object creates an illegal NULL type.
Page space is a 72 dpi coordinate system with the origin at the lower-left corner of the current page.
PDFAnnotation.hReturns the modification date of the annotation.
- (NSDate *)modificationDate
The modification date of the annotation, or NULL if there is no modification date.
– setModificationDatePDFAnnotation.hReturns the optional action performed when a user releases the mouse button within an annotation.
- (PDFAction *)mouseUpAction
The PDF action performed when a user releases the mouse button within an annotation.
– setMouseUpActionPDFAnnotation.hReturns the page that the annotation is associated with.
- (PDFPage *)page
The PDF page associated with the annotation.
The addAnnotation: method in the PDFPage class lets you associate an annotation with a page.
PDFAnnotation.hReturns the pop-up annotation associated with an annotation.
- (PDFAnnotationPopup *)popup
The pop-up annotation associated with the annotation, or NULL if no pop-up exists.
Pop-up annotations are not used with links or widgets. The bounds and open state of the pop-up annotation indicate the placement and open state of the pop-up window.
– setPopupPDFAnnotation.hSets the border style for the annotation.
- (void)setBorder:(PDFBorder *)border
The border style for the annotation. See “Constants” in the PDFBorder class for the available styles. The border style attribute is optional.
PDFAnnotation.hSets the bounding box for the annotation.
- (void)setBounds:(NSRect)bounds
The bounding box for the annotation. Use page space for bounds. The bounds attribute is required for all annotations.
Page space is a 72-dpi coordinate system with the origin at the lower-left corner of the current page.
PDFAnnotation.hSets the stroke color for the annotation.
- (void)setColor:(NSColor *)color
The stroke color for the annotation.
Where this color is used depends on the annotation type.
PDFAnnotation.hSpecifies the textual content associated with the annotation.
- (void)setContents:(NSString *)contents
A string representing the textual contents associated with the annotation.
Textual content is typically associated with PDFAnnotationText and PDFAnnotationFreeText annotations. For most annotation types, PDFView displays the associated textual content as a help tag.
PDFAnnotation.hSets the modification date of the annotation.
- (void)setModificationDate:(NSDate *)date
The modification date to associate with the annotation.
The modification date is optional.
– modificationDateSets the action performed when a user releases the mouse button within an annotation.
- (void)setMouseUpAction:(PDFAction *)action
The PDF action to be performed when a user releases the mouse button within an annotation.
The mouse-up action is optional.
– mouseUpActionSets the pop-up annotation associated with an annotation.
- (void)setPopup:(PDFAnnotationPopup *)popup
The pop-up annotation to associate with the annotation.
A pop-up annotation is not associated with links or widgets. The bounds and open state of the pop-up annotation indicate the placement and open state of the pop-up window.
– popupSpecifies whether the annotation should be displayed.
- (void)setShouldDisplay:(BOOL)display
Set this value to YES to display the annotation or NO otherwise.
PDFAnnotation.hSpecifies whether the annotation should appear when the document is printed.
- (void)setShouldPrint:(BOOL)print
Set this value to YES to ensure the annotation appears when the document is printed or NO otherwise.
PDFAnnotation.hSets the name of the user who created the annotation.
- (void)userName:(NSString *)name
The name of the user who created the annotation.
The user name is optional.
– userNameReturns a Boolean value indicating whether the annotation should be displayed.
- (BOOL)shouldDisplay
YES if the annotation should be displayed; otherwise NO.
PDFPage respects this flag when drawing.
PDFAnnotation.hReturns a Boolean value indicating whether the annotation should appear when the document is printed.
- (BOOL)shouldPrint
YES if the annotation should appear when the PDF document is printed; otherwise NO.
PDFPage respects this flag when printing.
PDFAnnotation.hReturns text for display as a help tag.
- (NSString *)toolTip
A string that contains help tag content, or NULL if there is no text associated with the annotation.
This method is equivalent to sending the message [self contents]. PDF Kit’s annotation subclasses override this behavior as appropriate. For example, a PDFAnnotationLink object displays a URL or page destination for its help tag.
PDFAnnotation.hReturns the type of the annotation.
- (NSString *)type
The type of the annotation. Types include Line, Link, Text, and so on, referring to the PDFAnnotation subclasses. In the Adobe PDF Specification, this attribute is called Subtype, and the common “type” for all annotations in the PDF Specification is Annot.
PDFAnnotation.hReturns the name of the user who created the annotation.
- (NSString *)userName
The name of the user who created the annotation, or NULL if no user name is set.
– setUserNamePDFAnnotation.h
Last updated: 2007-12-11