Nutrient iOS SDK

Add PDF annotations to your iOS app

  • 17+ annotation types — highlights, ink, stamps, notes, free text, shapes, links, and more
  • Native Apple Pencil support with pressure sensitivity and palm rejection
  • Import and export annotations as XFDF or Instant JSON for cross-platform synchronization
  • Annotation replies and review threads with accept, reject, and complete states

Need pricing or implementation help? Talk to Sales.

PDF ANNOTATIONS IN SWIFT

import PSPDFKit
let document = Document(url: documentURL)
// Create a highlight annotation.
let highlightAnnotation = HighlightAnnotation()
highlightAnnotation.pageIndex = 0
let boundingBox = CGRect(x: 200, y: 400, width: 50, height: 300)
highlightAnnotation.boundingBox = boundingBox
highlightAnnotation.rects = [boundingBox]
// Add it to the document.
document.add(annotations: [highlightAnnotation])

USE CASES

When developers reach for this SDK

Document review and markup

Users need to highlight passages, add sticky notes, and draw on PDFs. The SDK provides 17+ annotation types with a ready-made toolbar — or build a fully custom annotation UI.

Apple Pencil drawing on PDFs

iPad users expect native Pencil support. The SDK handles pressure sensitivity, palm rejection, and double-tap actions out of the box — no custom touch handling required.

Collaborative review threads

Teams need to discuss specific passages in a document. Annotation replies and review states (accepted, rejected, completed) turn PDFs into collaborative workspaces.

Synchronize annotations across platforms

Annotations created on iOS need to appear on web and Android. Export as XFDF or Instant JSON and import on any platform — or synchronize in real time with Document Engine.

PDF annotation capabilities for iOS

Create and edit annotations

Add annotations programmatically or let users create them interactively. 17+ types with full control over position, style, and behavior.


  • Highlights, underlines, strikeouts, and squiggles
  • Ink, shapes, free text, stamps, and notes
  • Undo/redo, z-index, drag-and-drop, and blend modes

Apple Pencil support

Native Apple Pencil integration with pressure-sensitive ink, palm rejection, and double-tap actions. Automatic detection and stylus mode switching.


  • Pressure-sensitive ink with DrawingPoint intensity
  • Automatic palm rejection when Pencil is active
  • Double-tap actions and stylus mode configuration

Import and export annotations

Move annotation data between platforms using XFDF (ISO standard, Adobe Acrobat compatible) or Instant JSON (compact, diff-friendly).


  • XFDF: ISO standard, Adobe Acrobat compatible
  • Instant JSON: Compact format with built-in diff support
  • Real-time synchronization via Document Engine

Replies and review threads

Add threaded comment discussions to any annotation. Support review workflows with accept, reject, cancel, and complete states.


  • Threaded text replies on any annotation
  • Review states: accepted, rejected, completed, cancelled
  • Compatible with Adobe Acrobat (PDF spec 1.6+)


ADVANCED CAPABILITIES

Beyond basic annotation

The SDK handles more than adding markup. Customize the annotation toolbar, persist user preferences, store annotations externally, and integrate with your app’s navigation and gestures.

Illustration of PDF annotation and collaboration features
Persist user annotation styles

AnnotationStyleManager remembers colors, line widths, and font sizes between sessions so users pick up exactly where they left off.


Drag-and-drop images onto PDFs

Users can drag images from Photos or Files directly onto a PDF page. The SDK creates a StampAnnotation automatically from the dropped content.


External annotation storage

Save annotations to XFDF files, databases, or external servers instead of embedding them in a PDF. Switch between save modes at runtime.


Undo and redo support

Built-in undo/redo for all annotation operations. Users can reverse changes with standard iOS gestures — no custom state management required.


Frequently asked questions

How do I add PDF annotations to an iOS app?

Install the Nutrient iOS SDK, create a Document from a file URL, and use document.add(annotations:) to add annotations programmatically. For interactive annotations, present a PDFViewController — users get a built-in toolbar with all 17+ annotation types. See the programmatic annotation guide for complete Swift examples.

What annotation types does the iOS PDF SDK support?

The SDK supports 17+ types: text markup (highlight, underline, strikeout, squiggly), drawing (ink, square, circle, line, polyline, polygon), text (note, free text), and special types (link, stamp, file attachment, sound, rich media). Redaction and widget annotations are available with their respective components.

Does the SDK support Apple Pencil for PDF annotations?

Yes. The SDK provides native Apple Pencil integration with pressure-sensitive ink drawing via DrawingPoint intensity values, automatic palm rejection, and double-tap action support. ApplePencilManager handles detection and enabling automatically — no custom touch handling code required. See the Apple Pencil guide.

How do I import and export annotations in XFDF format?

Use XFDFParser to import annotations from an XFDF file and XFDFWriter to export them. XFDF is an ISO standard format compatible with Adobe Acrobat. You can also use XFDFAnnotationProvider for automatic save and load. See the XFDF guide for complete examples.

How do I synchronize annotations across iOS, Android, and web?

Export annotations as Instant JSON — a compact format with built-in diff support designed for multi-platform synchronization. Use Document.generateInstantJSON() to export and Document.applyInstantJSON() to import. For real-time collaboration, connect to Document Engine, which handles conflict resolution automatically. See the Instant JSON guide.

Can users reply to annotations and leave review comments?

Yes. The SDK supports threaded text replies on any annotation and review states (accepted, rejected, completed, cancelled). Create replies by setting inReplyTo on a NoteAnnotation. The NoteAnnotationViewController provides a built-in comment UI. This is compatible with Adobe Acrobat (PDF spec 1.6+). See the replies guide.

How do I flatten annotations permanently into the PDF?

Use the Processor API with a ProcessorConfiguration. Call modifyAnnotations(ofTypes:change:) with .flatten to burn annotations into the PDF content. You can selectively flatten specific types — for example, flatten all annotations except links. See the flatten guide.

How do I create annotations programmatically in Swift?

All annotations follow the same pattern: Create an instance (e.g. HighlightAnnotation()), set its boundingBox and pageIndex, configure type-specific properties (like rects for highlights or lines for ink), and call document.add(annotations:). The SDK posts notifications when annotations are added, changed, or removed. See the programmatic creation guide.

FREE TRIAL

Ready to get started?

Add PDF annotations to your iOS app in minutes — no payment information required.

Explore more

More iOS SDK capabilities