Nutrient React Native SDK

Add PDF annotations in React Native

  • 17 annotation types — highlights, ink, text, stamps, shapes, notes, and more
  • Built-in annotation UI with programmatic API for full control
  • Import and export annotations via Instant JSON and XFDF
  • Single JavaScript API that runs natively on both iOS and Android

Need pricing or implementation help? Talk to Sales.

PDF ANNOTATIONS IN REACT NATIVE

const inkAnnotation: InkAnnotation =
new InkAnnotation({
type: 'pspdfkit/ink',
bbox: [89.59, 98.58, 143.13, 207.16],
pageIndex: 0,
isDrawnNaturally: false,
lines: {
intensities: [[0.5, 0.5, 0.5]],
points: [
[
[92.09, 101.08],
[92.09, 202.16],
[138.13, 303.24],
],
],
},
});
await this.pdfRef.current
?.getDocument()
.addAnnotations([inkAnnotation]);

USE CASES

When developers reach for this SDK

Let users mark up PDFs on mobile

Contracts, blueprints, and reports need highlights, comments, and signatures added directly on the device. The SDK provides a full annotation UI out of the box.

Sync annotations across devices

Export annotations as Instant JSON — a lightweight overlay that stores only changes, not the full PDF. Import them on another device to pick up where the user left off.

Flatten annotations for final delivery

Before sharing a document externally, flatten annotations into the PDF so they can’t be edited or removed. The SDK handles flatten, embed, remove, and print modes.

Share one codebase across iOS and Android

The same annotation API works on both platforms. Create, update, and remove annotations programmatically without platform-specific branching.

PDF annotation tools for React Native

Create and edit annotations

Add annotations programmatically or through the built-in UI. Update properties like color, position, and content on existing annotations.


  • Add, update, and remove annotations via API
  • Set author names and annotation flags
  • Detect annotation changes through event callbacks

Import and export annotations

Exchange annotations between documents and systems using Instant JSON or XFDF. Annotations are stored separately from the PDF.


  • Instant JSON — lightweight, stores only changes
  • XFDF — XML-based, compatible with Adobe Acrobat
  • Export unsaved annotations for external storage

Flatten annotations

Merge annotations permanently into the PDF content. Flattened annotations keep their visual appearance but can no longer be edited.


  • Flatten, embed, remove, or print modes
  • Process specific annotation types or all at once
  • Save to a new file — original document stays unchanged

Annotate on images

Add annotations to PNG, JPG, and TIFF images using the same API as PDF annotations. Annotation data is stored in XMP metadata.


  • Supports PNG, JPG, and TIFF image formats
  • Same annotation tools as PDF documents
  • Annotations stored in XMP format


ADVANCED CAPABILITIES

Beyond basic PDF annotations

The SDK handles more than adding highlights. Control annotation behavior with flags, track changes through event callbacks, restrict editing per type, and process annotations for final output — all through a unified API on iOS and Android.

Illustration of PDF annotation collaboration
Annotation flags

Control behavior per annotation — mark as read-only, hidden, locked, or print-only using standard PDF flags.


Change detection

Listen for annotation creation, modification, and deletion events to sync state or trigger workflows in your app.


Selective editing control

Disable annotation editing entirely, or restrict which annotation types users can modify through configuration.


Auto-save and manual save

Annotations save automatically on background events. Disable auto-save and trigger manual saves when you need full control.


Frequently asked questions

How do I add PDF annotations programmatically in React Native?

Create an annotation object with the required properties (type, bounding box, page index) and pass it to the addAnnotations() method on the document reference. The SDK supports 17 annotation types, including ink, text, highlights, stamps, and shapes. See the programmatic annotations guide for working examples.

What annotation types does the React Native PDF annotation SDK support?

The SDK supports 17 types: ink, highlight, underline, strikeout, squiggly, text, note, comment marker, stamp, image, link, redaction, and five shape types (rectangle, ellipse, line, polygon, and polyline). See the annotation types reference for the full list.

How do I import and export annotations in React Native?

The SDK supports two formats: Instant JSON and XFDF. Instant JSON stores only annotation changes as a lightweight overlay — use applyInstantJSON() to import and getAllUnsavedAnnotations() to export. XFDF is an XML-based format compatible with Adobe Acrobat — use importXFDF() and exportXFDF(). See the Instant JSON guide and XFDF guide.

How do I flatten annotations into a PDF in React Native?

Use the processAnnotations() function with the change type set to flatten. This merges annotations into the PDF visually while removing the annotation objects. You can flatten all annotations or target specific types. The result is saved to a new file. See the flatten annotations guide.

Can I annotate images in addition to PDFs?

Yes. The SDK supports annotations on PNG, JPG, and TIFF images using the same annotation tools as PDF documents. Annotation data is stored in XMP metadata format. See the annotate on images guide.

How do I detect when a user creates or modifies an annotation?

Register for the onAnnotationsChanged event on the NutrientView component. The callback fires when annotations are created, updated, or deleted through the UI, providing the change type and affected annotations. See the detect changes guide.

Can I disable annotation editing for specific types?

Yes. Set enableAnnotationEditing to false in the configuration to disable all editing, or use editableAnnotationTypes to allow editing only for specific types (e.g. only ink annotations). See the disable editing guide.

Does the annotation API work on both iOS and Android?

Yes. The programmatic annotation API — including creating, updating, removing, importing, exporting, and flattening annotations — is unified across both platforms. You use the same JavaScript methods regardless of the target platform. Native rendering ensures performance on both iOS and Android.

FREE TRIAL

Ready to get started?

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

Explore more

More React Native SDK capabilities