Nutrient iOS SDK
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 = 0let boundingBox = CGRect(x: 200, y: 400, width: 50, height: 300)highlightAnnotation.boundingBox = boundingBoxhighlightAnnotation.rects = [boundingBox]
// Add it to the document.document.add(annotations: [highlightAnnotation])import PSPDFKit
let document = Document(url: documentURL)
// Create an ink (drawing) annotation.let pdfLines = [ DrawingPoint(location: CGPoint(x: 200, y: 400), intensity: 0.5), DrawingPoint(location: CGPoint(x: 400, y: 600), intensity: 1),]let inkAnnotation = InkAnnotation(lines: [pdfLines])inkAnnotation.pageIndex = 0inkAnnotation.borderColor = .blueinkAnnotation.lineWidth = 5
document.add(annotations: [inkAnnotation])import PSPDFKit
let document = Document(url: documentURL)
// Create a sticky note annotation.let noteAnnotation = NoteAnnotation( contents: "Please review this section.")noteAnnotation.pageIndex = 0noteAnnotation.boundingBox = CGRect( x: 200, y: 400, width: 32, height: 32)
// Add it to the document.document.add(annotations: [noteAnnotation])USE CASES
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.
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.
Teams need to discuss specific passages in a document. Annotation replies and review states (accepted, rejected, completed) turn PDFs into collaborative workspaces.
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.
Add annotations programmatically or let users create them interactively. 17+ types with full control over position, style, and behavior.
Native Apple Pencil integration with pressure-sensitive ink, palm rejection, and double-tap actions. Automatic detection and stylus mode switching.
DrawingPoint intensity
Move annotation data between platforms using XFDF (ISO standard, Adobe Acrobat compatible) or Instant JSON (compact, diff-friendly).
Add threaded comment discussions to any annotation. Support review workflows with accept, reject, cancel, and complete states.
ADVANCED CAPABILITIES
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.
AnnotationStyleManager remembers colors, line widths, and font sizes between sessions so users pick up exactly where they left off.
Users can drag images from Photos or Files directly onto a PDF page. The SDK creates a StampAnnotation automatically from the dropped content.
Save annotations to XFDF files, databases, or external servers instead of embedding them in a PDF. Switch between save modes at runtime.
Built-in undo/redo for all annotation operations. Users can reverse changes with standard iOS gestures — no custom state management required.
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.
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.
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.
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.
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.
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.
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.
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
Add PDF annotations to your iOS app in minutes — no payment information required.
Also available for
More iOS SDK capabilities