Class

PDFAnnotation

An annotation in a PDF document.

Declaration

class PDFAnnotation : NSObject

Overview

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.

Topics

Initializing an Annotation

init(bounds: NSRect)

Initializes a PDF annotation object.

Deprecated

Accessing Information About an Annotation

var page: PDFPage?

Returns the page that the annotation is associated with.

var modificationDate: Date?

Returns the modification date of the annotation.

var userName: String?

Returns the name of the user who created the annotation.

var popup: PDFAnnotation?

Returns the pop-up annotation associated with an annotation.

var mouseUpAction: PDFAction?

Sets the action performed when a user releases the mouse button within an annotation.

Deprecated
var type: String?

Returns the type of the annotation.

var contents: String?

Returns the textual content (if any) associated with the annotation.

var toolTip: String?

Returns text for display as a help tag.

Deprecated

Managing Annotation Display Characteristics

var bounds: CGRect

Returns the bounding box for the annotation in page space.

var border: PDFBorder?

Sets the border style for the annotation.

class PDFBorder

An optional border for an annotation, drawn completely within the annotation rectangle.

var color: UIColor

Sets the stroke color for the annotation.

var hasAppearanceStream: Bool

Returns a Boolean value that indicates whether the annotation has an appearance stream associated with it.

Managing Annotation Drawing and Output

func draw(with: PDFDisplayBox)

Draws the annotation on its associated page.

Deprecated
var shouldDisplay: Bool

Returns a Boolean value indicating whether the annotation should be displayed.

var shouldPrint: Bool

Returns a Boolean value indicating whether the annotation should appear when the document is printed.

Supporting Types

enum PDFBorderStyle

PDF Kit annotation borders may have the following styles.

enum PDFLineStyle

The following constants specify the available line ending styles.

enum PDFMarkupType

The styles available for markup annotations in PDF Kit.

enum PDFTextAnnotationIconType

Text annotations can use the following icon types.

enum PDFWidgetControlType

The types of annotation buttons.

Relationships

Inherits From

See Also

Annotations

Adding Widgets to a PDF Document

Add text, button, and choice widgets to a PDF document.

Adding Custom Graphics to a PDF

Create and add custom annotation and page graphics to your PDF document.

Custom Graphics

Demonstrates adding a watermark to a PDF page.

PDF Widgets

Demonstrates adding widgets—interactive form elements—to a PDF document.

class PDFAction

An action that is performed when, for example, a PDF annotation is activated or an outline item is clicked.

class PDFDestination

A PDFDestination object describes a point on a PDF page.

class PDFBorder

An optional border for an annotation, drawn completely within the annotation rectangle.

Deprecated Annotations

These symbols are deprecated and should no longer be used.