---
title: "Magic Ink tool — Draw and detect annotation shapes in PDFs | Nutrient"
canonical_url: "https://www.nutrient.io/guides/android/annotations/magic-ink/"
md_url: "https://www.nutrient.io/guides/android/annotations/magic-ink.md"
last_updated: "2026-06-09T10:25:14.332Z"
description: "With Nutrient Android SDK 5.3, we introduced a new annotation tool: Magic Ink. This tool lets you draw on a PDF using the ink tool."
---

# Draw and detect annotation shapes in PDFs

With Nutrient Android SDK 5.3, we introduced a new annotation tool: Magic Ink. This tool allows you to draw on a PDF using the ink tool. Once you finish drawing, Nutrient will attempt to detect the shape you have drawn. If a shape is detected with high enough confidence, the drawn ink annotation will be replaced with a shape annotation. If not, the drawing is left untouched. This allows for faster annotation of your documents because you don’t need to switch between different tools.

## Supported transformations

We support transformations of the following drawings into their corresponding shape annotations:

- Circles ([`CircleAnnotation`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations/-circle-annotation/index.html))

- Rectangles ([`SquareAnnotation`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations/-square-annotation/index.html))

- Arrows ([`LineAnnotation`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations/-line-annotation/index.html) with the line end set to [`OPEN_ARROW`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations/-line-end-type/index.html))

- Lines ([`LineAnnotation`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations/-line-annotation/index.html) without a line end)

## Disabling the Magic Ink tool

The Magic Ink tool is defined as `MAGIC_INK` in the [`AnnotationTool`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.special_mode.controller/-annotation-tool/index.html) enum and is included in the annotation creation toolbar by default. You can easily disable it by using [`#enabledAnnotationTools()`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration.activity/-pdf-activity-configuration/-builder/enabled-annotation-tools.html) in your configuration:

### KOTLIN

```kotlin

val annotationTools = mutableListOf(*AnnotationTool.values())
annotationTools.remove(AnnotationTool.MAGIC_INK)
configuration.enabledAnnotationTools(annotationTools)

```

### JAVA

```java

List<AnnotationTool> annotationTools = Arrays.asList(AnnotationTool.values());
annotationTools.remove(AnnotationTool.MAGIC_INK);
configuration.enabledAnnotationTools(annotationTools);

```

Refer to the [annotation-editing configuration](https://www.nutrient.io/guides/android/annotations/configuring-annotation-editing.md#control-which-annotation-tools-are-enabled) guide for more details.

### Stripping shape detection templates

The Nutrient library AAR contains a `PSPDFShapeTemplates.json` asset file that defines shape templates used by the Magic Ink tool. This contributes to the size of your APK by approximately 900&nbsp;KB. If you don’t want to use the Magic Ink tool in your app, it is recommended that you strip this asset file while building your app to decrease your app’s size.

To strip the shape templates when building, extend the `android` closure in your `build.gradle` file with the following:

```groovy

android {
    aaptOptions {
        ignoreAssetsPattern "!PSPDFShapeTemplates.json"
    }
}

```
---

## Related pages

- [Flatten annotations on Android](/guides/android/annotations/flatten.md)
- [Rotate annotations seamlessly in your Android app](/guides/android/annotations/annotation-rotation.md)
- [Review and reply to annotations on Android](/guides/android/annotations/replies.md)
- [PDF annotation library for Android](/guides/android/annotations/introduction-to-annotations.md)
- [Select or deselect annotations on Android](/guides/android/annotations/select-or-deselect.md)
- [Android PDF annotation troubleshooting](/guides/android/annotations/troubleshooting.md)

