<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PDFKit",
  "identifier" : "/documentation/PDFKit/PDFAnnotation",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "PDFKit"
    ],
    "preciseIdentifier" : "c:objc(cs)PDFAnnotation"
  },
  "title" : "PDFAnnotation"
}
-->

# PDFAnnotation

An annotation in a PDF document.

```
class PDFAnnotation
```

## 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 has a specific location on a page and may offer interactivity with the user.

## Topics

### Creating an Annotation

[`init(bounds:forType:withProperties:)`](/documentation/PDFKit/PDFAnnotation/init(bounds:forType:withProperties:))

Creates a PDF annotation with the specified bounds, type, and optional properties.

[`PDFAnnotationSubtype`](/documentation/PDFKit/PDFAnnotationSubtype)

The type of annotation, such as circle, text, or ink.

### Accessing Information About an Annotation

[`page`](/documentation/PDFKit/PDFAnnotation/page)

Returns the page that the annotation is associated with.

[`modificationDate`](/documentation/PDFKit/PDFAnnotation/modificationDate)

Returns the modification date of the annotation.

[`userName`](/documentation/PDFKit/PDFAnnotation/userName)

Returns the name of the user who created the annotation.

[`type`](/documentation/PDFKit/PDFAnnotation/type)

Returns the type of the annotation.

[`action`](/documentation/PDFKit/PDFAnnotation/action)

An object that represents an action for a PDF element, such as a link annotation.

[`PDFAction`](/documentation/PDFKit/PDFAction)

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

[`PDFDestination`](/documentation/PDFKit/PDFDestination)

A `PDFDestination` object describes a point on a PDF page.

### Managing Annotation Drawing and Output

[`draw(with:in:)`](/documentation/PDFKit/PDFAnnotation/draw(with:in:))

Draws the annotation in a graphics context using page-space coordinates relative to the origin of the specified box.

[`shouldDisplay`](/documentation/PDFKit/PDFAnnotation/shouldDisplay)

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

[`shouldPrint`](/documentation/PDFKit/PDFAnnotation/shouldPrint)

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

### Modifying Annotation Attributes

[`annotationKeyValues`](/documentation/PDFKit/PDFAnnotation/annotationKeyValues)

A dictionary that contains a deep copy of the widget’s properties.

[`value(forAnnotationKey:)`](/documentation/PDFKit/PDFAnnotation/value(forAnnotationKey:))

Returns a deep copy of the key-value pairs of properties for the specified key.

[`setValue(_:forAnnotationKey:)`](/documentation/PDFKit/PDFAnnotation/setValue(_:forAnnotationKey:))

Sets a value in the annotation’s dictionary.

[`setBoolean(_:forAnnotationKey:)`](/documentation/PDFKit/PDFAnnotation/setBoolean(_:forAnnotationKey:))

Sets a Boolean value in the annotation’s dictionary.

[`setRect(_:forAnnotationKey:)`](/documentation/PDFKit/PDFAnnotation/setRect(_:forAnnotationKey:))

Sets a rectangle value in the annotation’s dictionary.

[`removeValue(forAnnotationKey:)`](/documentation/PDFKit/PDFAnnotation/removeValue(forAnnotationKey:))

Removes a value from the annotation’s dictionary.

[`PDFAnnotationKey`](/documentation/PDFKit/PDFAnnotationKey)

Keys for setting properties of annotations.

### Managing Annotation Display Characteristics

[`alignment`](/documentation/PDFKit/PDFAnnotation/alignment)

The alignment of the free text and text widget annotation’s text content.

[`bounds`](/documentation/PDFKit/PDFAnnotation/bounds)

Returns the bounding box for the annotation in page space.

[`contents`](/documentation/PDFKit/PDFAnnotation/contents)

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

[`font`](/documentation/PDFKit/PDFAnnotation/font)

The font the annotation uses to display text.

[`fontColor`](/documentation/PDFKit/PDFAnnotation/fontColor)

The font color the annotation uses to display text.

[`border`](/documentation/PDFKit/PDFAnnotation/border)

Sets the border style for the annotation.

[`PDFBorder`](/documentation/PDFKit/PDFBorder)

An optional border for an annotation that lies completely within the annotation rectangle.

[`isHighlighted`](/documentation/PDFKit/PDFAnnotation/isHighlighted)

A Boolean value that indicates whether the annotation is in a highlighted state, such as when the mouse is down on a link annotation.

[`color`](/documentation/PDFKit/PDFAnnotation/color)

Sets the stroke color for the annotation.

[`hasAppearanceStream`](/documentation/PDFKit/PDFAnnotation/hasAppearanceStream)

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

### Configuring Shape Annotations

[`interiorColor`](/documentation/PDFKit/PDFAnnotation/interiorColor)

The fill color for drawing a circle, line, or square annotation.

### Configuring Line Annotations

[`startPoint`](/documentation/PDFKit/PDFAnnotation/startPoint)

The point where a line begins, in annotation-space coordinates.

[`endPoint`](/documentation/PDFKit/PDFAnnotation/endPoint)

The point where a line ends, in annotation-space coordinates.

[`startLineStyle`](/documentation/PDFKit/PDFAnnotation/startLineStyle)

The style of the line annotation’s starting point, such as square or filled arrowhead.

[`endLineStyle`](/documentation/PDFKit/PDFAnnotation/endLineStyle)

The style of the line annotation’s ending point, such as square or filled arrowhead.

[`lineStyle(fromName:)`](/documentation/PDFKit/PDFAnnotation/lineStyle(fromName:))

Returns a line style that corresponds to the specified name.

[`name(for:)`](/documentation/PDFKit/PDFAnnotation/name(for:))

Returns the name of the line style, which matches the definition in the Adobe PDF Specification.

### Configuring Link Annotations

[`destination`](/documentation/PDFKit/PDFAnnotation/destination)

The destination for a link annotation.

[`url`](/documentation/PDFKit/PDFAnnotation/url)

A URL for a link annotation.

### Configuring Text Annotations

[`iconType`](/documentation/PDFKit/PDFAnnotation/iconType)

The type of icon to display for a pop-up text annotation.

[`PDFTextAnnotationIconType`](/documentation/PDFKit/PDFTextAnnotationIconType)

The types of icons that a text annotation can use.

[`PDFAnnotationTextIconType`](/documentation/PDFKit/PDFAnnotationTextIconType)

Constants for icon type values in text annotation property dictionaries.

### Configuring Pop-Up Annotations

[`popup`](/documentation/PDFKit/PDFAnnotation/popup)

Returns the pop-up annotation associated with an annotation.

[`isOpen`](/documentation/PDFKit/PDFAnnotation/isOpen)

A Boolean value that indicates whether the pop-up annotation is in an opened state, displaying its text content, or in a closed state, displaying an icon.

### Configuring Text Markup Annotations

[`markupType`](/documentation/PDFKit/PDFAnnotation/markupType)

The markup type that the annotation displays, either highlight, strikethrough, underline, or redact.

[`PDFMarkupType`](/documentation/PDFKit/PDFMarkupType)

The styles available for markup annotations in PDFKit.

[`quadrilateralPoints`](/documentation/PDFKit/PDFAnnotation/quadrilateralPoints)

An array of values that represents the points bounding the marked-up text.

### Configuring Widget Annotations

[`widgetFieldType`](/documentation/PDFKit/PDFAnnotation/widgetFieldType)

The type of widget annotation, such as button, choice, or text.

[`widgetStringValue`](/documentation/PDFKit/PDFAnnotation/widgetStringValue)

The string value of the widget annotation.

[`widgetDefaultStringValue`](/documentation/PDFKit/PDFAnnotation/widgetDefaultStringValue)

The string value that the widget reverts to when performing a reset form action.

[`fieldName`](/documentation/PDFKit/PDFAnnotation/fieldName)

The widget identifier for form annotation actions and behaviors.

[`backgroundColor`](/documentation/PDFKit/PDFAnnotation/backgroundColor)

The color of the widget’s background.

[`isReadOnly`](/documentation/PDFKit/PDFAnnotation/isReadOnly)

A Boolean value that determines whether the widget is editable.

[`PDFWidgetControlType`](/documentation/PDFKit/PDFWidgetControlType)

The types of annotation buttons.

[`PDFAppearanceCharacteristics`](/documentation/PDFKit/PDFAppearanceCharacteristics)

An object that represents appearance characteristics of a widget annotation.

### Configuring Text Widget Annotations

[`isMultiline`](/documentation/PDFKit/PDFAnnotation/isMultiline)

A Boolean value that indicates whether the text widget annotation displays multiple lines.

[`isPasswordField`](/documentation/PDFKit/PDFAnnotation/isPasswordField)

A Boolean value that indicates whether the text widget annotation displays a password field using bullet characters.

[`maximumLength`](/documentation/PDFKit/PDFAnnotation/maximumLength)

The maximum number of characters the text widget annotation allows.

[`hasComb`](/documentation/PDFKit/PDFAnnotation/hasComb)

A Boolean value that indicates whether the annotation divides the text widget’s bounds into equally spaced segments, such as in a form entry field.

### Configuring Button Widget Annotations

[`widgetControlType`](/documentation/PDFKit/PDFAnnotation/widgetControlType)

The type of button widget control, either radio button, push button, or checkbox.

[`buttonWidgetState`](/documentation/PDFKit/PDFAnnotation/buttonWidgetState)

The current state of the button widget annotation.

[`PDFWidgetCellState`](/documentation/PDFKit/PDFWidgetCellState)

The state of a button annotation, either on, off, or mixed.

[`buttonWidgetStateString`](/documentation/PDFKit/PDFAnnotation/buttonWidgetStateString)

A string value that differentiates button widgets in the same group, such as to identify mutually exclusive radio buttons from each other.

[`caption`](/documentation/PDFKit/PDFAnnotation/caption)

The title of push button widget annotations.

[`allowsToggleToOff`](/documentation/PDFKit/PDFAnnotation/allowsToggleToOff)

A Boolean value that indicates whether clicking or tapping a selected radio button toggles it to an unselected state.

[`radiosInUnison`](/documentation/PDFKit/PDFAnnotation/radiosInUnison)

A Boolean value that indicates whether radio buttons in a group turn on and off in unison.

### Configuring Choice Widget Annotations

[`choices`](/documentation/PDFKit/PDFAnnotation/choices)

An array of strings that specifies the options in either a list or a pop-up menu.

[`isListChoice`](/documentation/PDFKit/PDFAnnotation/isListChoice)

A Boolean value that indicates whether the choice widget annotation is a list or a pop-up menu.

[`values`](/documentation/PDFKit/PDFAnnotation/values)

An array of strings that specifies the export values for items in a list or a pop-up menu.

### Configuring Ink Annotations

[`paths`](/documentation/PDFKit/PDFAnnotation/paths)

An array of bezier paths, in annotation-space coordinates, that compose the annotation.

[`add(_:)`](/documentation/PDFKit/PDFAnnotation/add(_:))

Adds a bezier path to the ink annotation.

[`remove(_:)`](/documentation/PDFKit/PDFAnnotation/remove(_:))

Removes a bezier path from an ink annotation.

### Configuring Stamp Annotations

[`stampName`](/documentation/PDFKit/PDFAnnotation/stampName)

The name of the stamp, a text or graphics annotation that emulates a rubber stamp effect.

### Deprecated

[Deprecated Symbols](/documentation/PDFKit/deprecated-symbols)

Review unsupported symbols and their replacements.

### Instance Properties

[`isActivatableTextField`](/documentation/PDFKit/PDFAnnotation/isActivatableTextField)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)