---
title: "Configure measurements in a PDF on Android | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/android/measurements/configure-measurements/"
md_url: "https://www.nutrient.io/guides/android/measurements/configure-measurements.md"
last_updated: "2026-06-09T10:24:29.038Z"
description: "Measure distance and area in a PDF using Nutrient Android SDK starting with version 8.4. To measure distance and area in your app."
---

# Configure measurements in a PDF on Android

Measure distance and area in a PDF using Nutrient Android SDK starting with version 8.4. To measure distance and area in your app, [contact the Sales team](https://www.nutrient.io/contact-sales) to add the Measurement Tools component to your license, or run the SDK in trial mode.

Configure measurements in one of the following ways:

- [Configure the scale of the measurements](#configuring-scales), which determines the size of an object on a page relative to the size of a corresponding real-world object. For example, a document shows the floor plan of a house where one centimeter on the floor plan represents two meters in the house.

- [Configure the precision of the measurements](#configuring-precision), which determines the number of decimal places displayed in the measured value.

- [Disable snapping and magnification](#disabling-snapping-and-magnification).

- [Disable measurement tools](#disabling-measurement-tools).

The configurations for scale and precision are stored in a document by [`MeasurementValueConfiguration` objects](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations.measurements/-measurement-value-configuration/index.html), and they persist when you close and reopen the document on any device when they’re used by annotations. The snapping setting persists over app restarts, but it isn’t stored in the document like scale and precision are.

## Configuring scales

The scale determine the size of an object on a page relative to the size of a corresponding real-world object. For example, a document shows the floor plan of a house where one centimeter on the floor plan represents two meters in the house.

You can have multiple scales configured. The currently selected scale is displayed in the button in the bottom-right corner. Any future measurements use the currently selected scale.

Configure scale in one of the following ways:

- [Using the built-in user interface (UI)](#configuring-scales-using-the-built-in-ui)

- [Programmatically](#configuring-scales-programmatically)

### Configuring scales using the built-in UI

Configure scale in one of the following ways:

- [Create a scale from the **Annotation Inspector**](#creating-a-scale-from-the-annotation-inspector)

- [Create a scale using the **Calibrate Length** tool](#creating-a-scale-using-the-calibrate-length-tool)

- [Change the current scale](#changing-the-current-scale)

- [Edit a scale](#editing-a-scale)

- [Change the scale for an existing measurement](#changing-the-scale-for-a-measurement)

#### Creating a scale from the annotation inspector

1. Tap a measurement.

2. Open the **Scale** view in one of the following ways:
   - Tap the **Inspector** button that appeared in the toolbar and then tap **Scale**.
   - Tap the button that appears in the bottom-right corner.

3. Set the following parameters:
   - Optional: In **Name**, set the scale name.
   - In **Scale**, specify how length on a page corresponds to length in the real world.
   - In **Precision**, specify the number of decimal places to display. You can display a maximum of four decimal places for units using the International System of Units (SI). Additionally, you can display four proper fractions for imperial units.

The example below creates a new scale from the **Inspector**:

#### Creating a scale using the Calibrate Length tool

1. Select the calibration tool from the annotation toolbar. (If you can’t locate it, touch and hold a measurement to open up the sub-toolbar.)

2. Tap the **Calibrate Length** tool.

3. Draw a line used for calibrating the scale. Recommended: If the PDF has a drawn scale, use it as the scale’s reference line.

4. Set the following parameters in the **Calibrate Length**:
   - Optional: In **Name**, set the scale name.
   - In **Calibrate Length**, set the real world length corresponding to the drawn line.
   - In **Precision**, specify the number of decimal places to display. You can display a maximum of four decimal places for units using the International System of Units (SI). Additionally, you can display four proper fractions for imperial units.

The drawn line is automatically removed once the scale is confirmed.

The example below creates a new scale based on the **Calibrate Length** tool and adds a measurement based on that scale.

#### Changing the current scale

To change the currently used scale, follow these steps:

1. Tap a measurement.

2. Open the **Scale** view in one of the following ways:
   - Tap the **Inspector** button that appeared in the toolbar.
   - Tap the button that appeared in the bottom-right corner.

3. Tap **Scale**.

4. Select the scale you want the measurement tool to start using.

#### Editing a scale

To modify an existing scale, follow these steps:

1. Tap a measurement.

2. Open the **Scale** view in one of the following ways:
   - Tap the **Inspector** button that appeared in the toolbar.
   - Tap the button that appeared in the bottom-right corner.

3. Tap **Scale**.

4. Swipe the scale you want to modify and tap **Edit**.

5. Change any of the parameters.

The following rules apply when modifying a scale:

- When the modified scale is used by a measurement, all measurements using this scale will be updated.

- When the scale is modified and matches another existing scale (which is determined by comparing the scale value and precision of both scales), a popup window appears to confirm the operation. After accepting the changes, the measurements using the modified scale are assigned to the existing scale and the edited scale is deleted.

#### Changing the scale for a measurement

You can configure the scale of each measurement individually. Configuring the scale on one measurement sets the initial scale value for all future measurements.

To change the scale for a measurement, use the following steps:

1. Tap a measurement.

2. Tap **Inspector**.

3. Tap **Scale**.

4. Select the scale you want to use and close the scale list inspector.

After this operation, the new scale is assigned to the selected measurement.

### Configuring scales programmatically

You can programmatically perform the following operations on a scale:

- [Create a new scale](#creating-a-scale-programmatically).

- [Edit an existing scale](#editing-a-scale-programmatically).

- [Remove an existing scale](#removing-a-scale-programmatically).

#### Creating a scale programmatically

To configure a scale programmatically, follow these steps:

1. Create a new [`MeasurementValueConfiguration` object](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations.measurements/-measurement-value-configuration/index.html). It uses the following parameters:
   - Optional: `name` — The name of the scale.
   - `Scale` — The scale values and their units, represented by a [`Scale` object](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations.measurements/-scale/index.html).
   - `Precision` — The precision of the measurement, represented by the [`Precision` enumeration](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations.measurements/-measurement-precision/index.html).

2. Add the created object to the document with the `add` method from the [`MeasurementValueConfigurationEditor` interface](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations.measurements/-measurement-value-configuration-editor/index.html). It uses the following parameters:
   - `value` — The `MeasurementValueConfiguration` object.
   - `addToUndo` — A Boolean value that specifies if the modification is recorded to the undo stack.

The example below creates a scale so that one centimeter in a floor plan document represents two meters in a house with one-decimal point precision, and adds it to the document:

```kotlin

val scaleValue = Scale(1.0f, Scale.UnitFrom.CM, 2.0f, Scale.UnitTo.M)
val scale = MeasurementValueConfiguration("Main Scale", scaleValue, MeasurementPrecision.ONE_DP)
MeasurementValueConfigurationEditor.add(scale, true)

```

#### Editing a scale programmatically

To edit an existing scale programmatically, use the `modify` method from the [`MeasurementValueConfigurationEditor` interface](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations.measurements/-measurement-value-configuration-editor/index.html). It uses the following parameters:

- `oldValue` — The `MeasurementValueConfiguration` object you want to modify.

- `newValue` — A new `MeasurementValueConfiguration` object with the updated parameters.

- `modifyAssociatedAnnotations` — A Boolean value that specifies whether measurements using the `oldValue` are to be updated.

- `addToUndo` — A Boolean value that specifies if the modification is recorded to the undo stack.

The example below modifies the scale value from 1:1 to 1:2 and updates all previously drawn measurements:

```kotlin

val scaleValue = Scale(1.0f, Scale.UnitFrom.CM, 1.0f, Scale.UnitTo.CM)
val oldScale = MeasurementValueConfiguration("One-to-One", scaleValue, MeasurementPrecision.ONE_DP)
// Update the scale value.
scaleValue = Scale(1.0f, Scale.UnitFrom.CM, 2.0f, Scale.UnitTo.CM)
val newScale = MeasurementValueConfiguration("One-to-One", scaleValue, MeasurementPrecision.ONE_DP)
MeasurementValueConfigurationEditor.modify(oldScale, newScale, true, true)

```

#### Removing a scale programmatically

To remove a scale programmatically, use the `remove` method from the [`MeasurementValueConfigurationEditor` interface](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations.measurements/-measurement-value-configuration-editor/index.html). It uses the following parameters:

- `value` — The `MeasurementValueConfiguration` object you want to remove.

- `deleteAssociatedAnnotations` — A Boolean value that specifies whether to delete measurements using the deleted object.

- `addToUndo` — A Boolean value that specifies if the modification is recorded to the undo stack.

The example below deletes a scale and all measurements using it:

```kotlin

val scaleValue = Scale(1.0f, Scale.UnitFrom.CM, 1.0f, Scale.UnitTo.CM)
val scale = MeasurementValueConfiguration("", scaleValue, MeasurementPrecision.ONE_DP)
MeasurementValueConfigurationEditor.delete(scale, true, true)

```

## Configuring precision

The precision determines the number of decimal places displayed in the measured value.

Configure precision in one of the following ways:

- [Using the built-in user interface (UI)](#configuring-precision-using-the-built-in-ui)

- [Programmatically](#configuring-precision-programmatically)

### Configuring precision using the built-in UI

To configure the number of decimal places displayed in a measured value using the built-in UI, follow these steps:

1. Tap the measurement.

2. In the toolbar that appears, tap **Inspector**.

3. Tap **Scale**.

4. Swipe the scale you want to modify and tap **Edit**.

5. In **Precision**, specify the number of decimal places to display. You can display a maximum of four decimal places for units using the International System of Units (SI). Additionally, you can display four proper fractions for imperial units.

Changing the precision of a measurement creates a new scale assigned to the selected measurement. The newly created scale is a copy of the previously used scale with the precision changed to the new value.

Setting the precision only affects the visible value label. You can retrieve the unrounded measurement value from the `Annotation` object via the [`getMeasurementInfo` method](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations/-annotation/get-measurement-info.html).

You can configure the precision of each measurement individually. Configuring the precision on one measurement sets the initial precision value for all future measurements.

### Configuring precision programmatically

To configure the precision of a measurement programmatically, use the [`MeasurementPrecision` enumeration](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations.measurements/-measurement-precision/index.html).

Setting the precision only affects the visible value label. You can retrieve the unrounded measurement value via the API.

A measurement displays a maximum of four decimal places with the additional four proper fractions for imperial units.

## Disabling snapping and magnification

By default, Nutrient snaps measurements to existing drawings on a page (the **Snap to Point** option) and to the measurement itself (the **Snap to Self** option). This helps you make precise measurements. A built-in magnifier displays the zoomed-in view of the currently drawn measurement.

Snapping and magnification are enabled by default. Disable snapping and magnification in one of the following ways:

- [Disable snapping using the built-in user interface (UI)](#disabling-snapping-using-the-built-in-ui)

- [Disable snapping and magnification programmatically](#disabling-snapping-and-magnification-programmatically)

### Disabling snapping using the built-in UI

To disable snapping in a document using the built-in UI, follow these steps:

1. Tap **Settings**.

2. Disable the **Snap to Point** or the **Snap to Self** toggle.

### Disabling snapping and magnification programmatically

To disable snapping to point programmatically, use the [`isMeasurementSnappingEnabled` method](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.preferences/-p-s-p-d-f-kit-preferences/is-measurement-snapping-enabled.html):

```kotlin

PSPDFKitPreferences.get(context).isMeasurementSnappingEnabled = false

```

To disable snapping to point programmatically, use the [`isSnapToSelfEnabled` method](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.preferences/-p-s-p-d-f-kit-preferences/is-snap-to-self-enabled.html):

```kotlin

PSPDFKitPreferences.get(context).isSnapToSelfEnabled = false

```

To disable the magnifier programmatically, use the [`enableMagnifier` method](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration/-pdf-configuration/is-magnifier-enabled.html):

```kotlin

val configuration = PdfConfiguration.Builder().enableMagnifier(false).build()

```

This also disables the magnifier for all other Nutrient features, such as text selection.

## Disabling measurement tools

By default, measurement tools are enabled if your license includes the Measurement Tools component.

To disable all measurement tools, use the [`setMeasurementToolsEnabled` method](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration/-pdf-configuration/-builder/set-measurement-tools-enabled.html):

```kotlin

val configuration = PdfConfiguration.Builder().setMeasurementToolsEnabled(false).build()

```

To disable each measurement tool individually, use the [`enabledAnnotationTools` method](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration/-pdf-configuration/-builder/enabled-annotation-tools.html). The example below disables the elliptical and rectangular area measurement tools:

```kotlin

val annotationTools = mutableListOf(*AnnotationTool.values())
annotationTools.remove(AnnotationTool.MEASUREMENT_AREA_ELLIPSE)
annotationTools.remove(AnnotationTool.MEASUREMENT_AREA_RECT)

val configuration = PdfConfiguration.Builder().enabledAnnotationTools(annotationTools).build()

```
---

## Related pages

- [Measure distance in a PDF on Android](/guides/android/measurements/measure-distance.md)
- [Measure distance and area in a PDF on Android](/guides/android/measurements.md)
- [Measure area in a PDF on Android](/guides/android/measurements/measure-area.md)

