---
title: "Define annotation behavior in a document with flags in Flutter | Nutrient"
canonical_url: "https://www.nutrient.io/guides/flutter/annotations/create-edit-and-remove/annotation-flags/"
md_url: "https://www.nutrient.io/guides/flutter/annotations/create-edit-and-remove/annotation-flags.md"
last_updated: "2026-05-15T09:08:03.624Z"
description: "Every Annotation in a document can specify AnnotationFlags that further define an annotation’s behavior and capabilities."
---

# Define annotation behavior with flags in Flutter

Every [`Annotation`](https://pub.dev/documentation/nutrient_flutter/latest/nutrient_flutter/Annotation-class.html) in a document can specify [`AnnotationFlag`](https://pub.dev/documentation/nutrient_flutter/latest/nutrient_flutter/AnnotationFlag.html)s that further define an annotation’s behavior and capabilities. Access these flags directly on your annotation objects using [`Annotation.flags`](https://pub.dev/documentation/nutrient_flutter/latest/nutrient_flutter/AnnotationFlag.html).

## Capabilities of flags

Annotation flags are part of the PDF specification and define an annotation’s behavior, its presentation on the screen and on paper, and the available editing features given to your users. Here are a few examples of things you can do with flags:

- An annotation marked `hidden` won’t be displayed or printed.

- By specifying `print`, the annotation will be added to the print output while remaining hidden onscreen.

- If you want to prevent your users from editing an annotation, set the `locked` and `lockedContents` flags.

Check out the [`AnnotationFlags`](https://pub.dev/documentation/nutrient_flutter/latest/nutrient_flutter/AnnotationFlag.html) API reference for a complete list of available flags.

## Example

Here’s an example of how to create a locked annotation, i.e. an annotation that can’t be edited by your users:

```dart

import 'package:nutrient_flutter/nutrient_flutter.dart';

void createReadOnlyAnnotation() {
  // Create a new text annotation.
  final annotation = FreeTextAnnotation(
	 pageIndex: 0,
    bbox: [50.0, 650.0, 200.0, 50.0],
	 text: TextContent(
      format: TextFormat.plain,
      value: 'This is a free text annotation',
    ),
	 // Set the `readOnly`s flag to prevent editing.
	 flags: [AnnotationFlag.readOnly, AnnotationFlag.print],... // Other annotation properties.
  );
  // Add the annotation to the document.
  pdfDocument.addAnnotation(annotation);
}

```
---

## Related pages

- [Update PDF annotation properties in Flutter](/guides/flutter/annotations/create-edit-and-remove/update-properties.md)
- [Set the annotation author in Flutter](/guides/flutter/annotations/create-edit-and-remove/author-name.md)
- [Programmatically manage PDF annotations in Flutter](/guides/flutter/annotations/create-edit-and-remove/programmatic.md)
- [Disable annotation editing in Flutter](/guides/flutter/annotations/create-edit-and-remove/disable-editing.md)

