---
title: "Flatten PDF annotation in Flutter"
canonical_url: "https://www.nutrient.io/guides/flutter/annotations/flatten/"
md_url: "https://www.nutrient.io/guides/flutter/annotations/flatten.md"
last_updated: "2026-05-30T02:20:01.293Z"
description: "Learn to flatten PDF annotations in Flutter using Nutrient Flutter SDK. Utilize the `processAnnotations` function to control annotation processing effectively."
---

# Flatten annotations in Flutter

Nutrient Flutter SDK allows you to create a new document with processed (embedded, flattened, removed, or printed) annotations using the `processAnnotations(AnnotationType type, AnnotationProcessingMode processingMode, String destinationPath)` function.

## Parameters

This guide shows how to use the `processAnnotations()` function and its parameters.

### Processing mode

Since Nutrient Flutter SDK version 3.12, the processing mode parameter has been changed from a string to an enum type, [`AnnotationProcessingMode`](https://pub.dev/documentation/nutrient_flutter/latest/nutrient_flutter/AnnotationProcessingMode.html), which specifies how Nutrient should include annotations in the resulting document.

| **Processing mode** | **Description**                                                                                                                                                   |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `flatten`           | The annotation will be flattened. Its visual representation is kept intact, but it can no longer be modified. The annotation object is removed from the document. |
| `remove`            | The annotation will be removed.                                                                                                                                   |
| `embed`             | The annotation will be embedded into the resulting document, allowing it to still be modified.                                                                    |
| `print`             | Processes the document for printing. Flattens annotations that can be printed and removes the remaining ones.                                                     |

### Annotation type

The [`AnnotationType`](https://pub.dev/documentation/nutrient_flutter/latest/nutrient_flutter/AnnotationType.html) parameter is a string that specifies which annotation types Nutrient should process. See the list of all [supported annotation types](https://pub.dev/documentation/nutrient_flutter/latest/nutrient_flutter/AnnotationType.html). To process all annotations, including forms, set the value for the annotation type parameter to `all` or `none`.

### Destination path

The destination path parameter is a string that specifies the path where the resultant processed file will be stored. By default, it’ll be stored under the [document directory](https://developer.apple.com/documentation/foundation/filemanager/searchpathdirectory/documentdirectory).

Make sure you save all annotations before processing the document. For more details, refer to our guide showing how to [manually save](https://www.nutrient.io/guides/flutter/save-a-document.md#manual-save) annotations in a document.

## Usage

A typical call of the `processAnnotations` function looks like this:

```dart

await pdfDocument.processAnnotations(AnnotationType.all, AnnotationProcessingMode.flatten, 'PDFs/export.pdf');

```
---

## Related pages

- [Comprehensive PDF annotation library for Flutter applications](/guides/flutter/annotations.md)

