---
title: "Hide PDF annotations on Android | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/android/annotations/configuring-editablevisible-annotation-types/"
md_url: "https://www.nutrient.io/guides/android/annotations/configuring-editablevisible-annotation-types.md"
last_updated: "2026-05-23T00:08:17.979Z"
description: "Learn how to hide specific annotation types in Nutrient by configuring excludedAnnotationTypes for customized PDF rendering. Enhance your document display now!"
---

# Hiding annotations on Android

By default, Nutrient will render all known annotation types. See [`AnnotationType`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations/-annotation-type/index.html) for a full list of the available types.

## Hiding specific annotation types

When building your [`PdfConfiguration`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration/-pdf-configuration/-builder/index.html), you have the ability to specify [`excludedAnnotationTypes`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration/-pdf-configuration/-builder/excluded-annotation-types.html). This allows you to exclude specific types from being rendered.

For example, to allow only highlights and drawings to be rendered, configure the document like this:

### KOTLIN

```kotlin

val configuration: PdfConfiguration =...

// Create a list with all annotation types.
val excludedAnnotationTypes = ArrayList(EnumSet.allOf(AnnotationType::class.java))
// Then remove the ones you would like to display.
excludedAnnotationTypes.remove(AnnotationType.HIGHLIGHT)
excludedAnnotationTypes.remove(AnnotationType.INK)
// Apply this to your configuration.
configuration.excludedAnnotationTypes(excludedAnnotationTypes)

```

### JAVA

```java

PdfConfiguration configuration =...;

// Create a list with all annotation types.
ArrayList<AnnotationType> excludedAnnotationTypes = new ArrayList<>(EnumSet.allOf(AnnotationType.class));

// Then remove the ones you would like to display.
excludedAnnotationTypes.remove(AnnotationType.HIGHLIGHT);
excludedAnnotationTypes.remove(AnnotationType.INK);

// Apply this to your configuration.
configuration.excludedAnnotationTypes(excludedAnnotationTypes);

```

Or, to exclude only highlights and drawings, configure the document like this:

### KOTLIN

```kotlin

val configuration: PdfConfiguration =...

// Excludes ink and stamps from being rendered.
configuration.excludedAnnotationTypes(ArrayList(EnumSet.of(AnnotationType.INK, AnnotationType.HIGHLIGHT)))

```

### JAVA

```java

PdfConfiguration configuration =...;

// Excludes ink and stamps from being rendered.
configuration.excludedAnnotationTypes(new ArrayList<>(EnumSet.of(AnnotationType.INK, AnnotationType.HIGHLIGHT)));

```

You need to configure this before creating the [`PdfFragment`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/index.html). If you are using a [`PdfActivity`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-activity/index.html), you can update it using [`setConfiguration()`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-activity/set-configuration.html).

### Including and excluding all annotation types

You can also exclude all annotation types by passing in all types:

### KOTLIN

```kotlin

val configuration: PdfConfiguration =...

// Passing all annotation types will exclude all annotations from being rendered.
configuration.excludedAnnotationTypes(ArrayList(EnumSet.allOf(AnnotationType::class.java)))

```

### JAVA

```java

PdfConfiguration configuration =...;

// Passing all annotation types will exclude all annotations from being rendered.
configuration.excludedAnnotationTypes(new ArrayList<>(EnumSet.allOf(AnnotationType.class)));

```

And to include them, pass in an empty array:

### KOTLIN

```kotlin

val configuration: PdfConfiguration =...

// Passing an empty list will render all annotations.
configuration.excludedAnnotationTypes(ArrayList())

```

### JAVA

```java

PdfConfiguration configuration =...;

// Passing an empty list will render all annotations.
configuration.excludedAnnotationTypes(new ArrayList<>());

```
---

## Related pages

- [Enhance PDF annotation with custom appearance streams](/guides/android/annotations/appearance-streams.md)
- [Configure PDF annotations in Android](/guides/android/annotations/annotation-configuration.md)
- [Customizing the note icon on Android](/guides/android/annotations/customize-annotation-rendering.md)
- [Store custom data in annotations on Android](/guides/android/annotations/custom-data-in-annotations.md)
- [JavaScript support in annotations on Android](/guides/android/miscellaneous/javascript-api.md)

