> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/xamarin/measurement/measurement-tools.md).

# Measurement

Learn how to customize PDF measurement tools in Android and iOS using Apryse SDK. Create distance, perimeter, and area annotations with precision. Find out more here! The Apryse Xamarin SDK streamline

Apryse SDK has built-in tools allowing you to create measurement annotations and provides a UI to modify common properties.

{% tabs %}
{% tab title="Android" %}

## Customizing PDF measurement tool in Android

{% hint style="info" %}
**This tutorial only applies to Xamarin.Android. See Xamarin.iOS equivalent here .**
{% endhint %}

By default, creating and editing measurement annotations in the drop-in components [DocumentActivity](/xamarin/guides/android/basics/open.md) and [PDFViewCtrlTabHostFragment](/xamarin/guides/android/basics/open.md) are automatically enabled unless disabled using [`ToolManagerBuilder`](https://sdk.apryse.com/api/xamarinandroid/tools/api/pdftron.PDF.Config.ToolManagerBuilder.html). You can learn more about configuring ToolManager [here](/xamarin/annotation/config-annot-tools.md#android).

To create a measurement annotations, tap and hold on an area of the PDF without any text or annotations to bring up the long-press quick menu. Then find a group called `Measure` in the overflow menu.

There are three measurement tools:

* Distance: [RulerCreate](https://sdk.apryse.com/api/xamarinandroid/tools/api/pdftron.PDF.Tools.RulerCreate.html)
* Perimeter: [PerimeterMeasureCreate](https://sdk.apryse.com/api/xamarinandroid/tools/api/pdftron.PDF.Tools.PerimeterMeasureCreate.html)
* Area: [AreaMeasureCreate](https://sdk.apryse.com/api/xamarinandroid/tools/api/pdftron.PDF.Tools.AreaMeasureCreate.html)

![](https://653871032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgjsBtuYmcKhWOdM9VCg4%2Fuploads%2Fgit-blob-907e3783ada20f7e654355097a03c7193bb70ac1%2F77c37d8737315a2f369d76eaf71e05e707337591-600x1191.gif?alt=media)

## Enable end point snapping

Snapping is useful when you want to precisely place annotations in documents by snapping them to lines & objects. The point snapping API can be used to easily place annotations to the exact location.

![](https://653871032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgjsBtuYmcKhWOdM9VCg4%2Fuploads%2Fgit-blob-18013b0426e6029312439bf72cca0d6f70d6ec22%2F7b385a49c62bd64bae4995fbaeb74323d1fe3516-422x818.gif?alt=media)

This is disabled by default and can be enabled as follows:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
mToolManager.SetSnappingEnabledForMeasurementTools(true);
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
mToolManager.setSnappingEnabledForMeasurementTools(true);
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code lineNumbers="true" %}

```kotlin
mToolManager.isSnappingEnabledForMeasurementTools = true
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Calibration

The **Calibrate** menu option for measurement annotations allows you to determine a PDF's scale, enabling accurate measurements.

![](https://653871032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgjsBtuYmcKhWOdM9VCg4%2Fuploads%2Fgit-blob-5741166704fdc85117ca7c9af801c7e3632f5f0d%2Ff6f7e44402cda99a38b15944e6417c69b7782f84-600x1191.gif?alt=media)
{% endtab %}

{% tab title="iOS" %}

## Customizing PDF measurement tool in iOS

{% hint style="info" %}
**This tutorial only applies to Xamarin.iOS. See Xamarin.Android equivalent here .**
{% endhint %}

## Overview

PDF documents allow line, polyline and polygon annotations to contain measurement information to measure the distance, perimeter, and area of parts of a document. A scale can be defined so that for example, one inch on the document is equivalent to one foot, allowing you determine the actual size of things in an architectural diagram once you know the scale.

The Apryse iOS SDK has built-in tools allowing you to create these annotations and provides a UI to modify the scale and precision of these measurements.

## Measurement tools

There are three measurement tools:

* `PTRulerCreate` for measuring straight line distances
* `PTPerimeterCreate` for measuring perimeters by drawing a polyline shape
* `PTAreaCreate` for measuring the area enclosed by a polygon

Each of these have a scale ratio and precision which can be changed using the UI. The scale defines the translation from document space to world space as described in the [Overview](https://docs.apryse.com) section above. The precision defines the number of significant digits to which the measurement information is saved to the annotation and in the case of ruler annotations, displayed to the user in the form of a caption.

![](https://653871032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgjsBtuYmcKhWOdM9VCg4%2Fuploads%2Fgit-blob-60d411001449f77a4465677ac73e1f14d788f3f1%2Fce643a3ccc0db210ebdb5278e0886ca99c28f0ef-1170x2532.png?alt=media)

To create a measurement annotation, tap and hold on an area of the PDF without any text or annotations to bring up the long-press menu. Then scroll through the menu to find the "Measure..." option. Clicking that option will reveal the Ruler, Perimeter, and Area tools.

![](https://653871032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgjsBtuYmcKhWOdM9VCg4%2Fuploads%2Fgit-blob-b9301b33c9c6138a30125a9737190ac3dd18aea0%2F7f4780a3a1f2d8e3a7dcf3b961176ea9954a959f-1170x2532.png?alt=media)

## Point snapping

Snapping is useful when you want to precisely place annotations in documents by snapping them to lines & objects. The point snapping API can be used to easily place annotations to the exact location.

![](https://653871032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgjsBtuYmcKhWOdM9VCg4%2Fuploads%2Fgit-blob-4f5bb78712aa53994f4b90b01cc2c97caea1571d%2F6d48e8d43b45af15cb29e8570062306344ab6bdd-720x1280.gif?alt=media)

Measurement tool snapping.

This is disabled by default but can be enabled for measurement tools as follows:

{% code lineNumbers="true" %}

```csharp
// Enable end-point snapping for measurement tools
mToolManager.IsSnapToDocumentGeometryEnabled = true;
```

{% endcode %}

There is also a UI toggle to enable and disable snapping for all measurement tools. This is displayed in the style picker for measurement tools and annotations.

![](https://653871032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgjsBtuYmcKhWOdM9VCg4%2Fuploads%2Fgit-blob-60d411001449f77a4465677ac73e1f14d788f3f1%2Fce643a3ccc0db210ebdb5278e0886ca99c28f0ef-1170x2532.png?alt=media)

## Calibration

The **Calibrate** menu option for measurement annotations allows you to specify a PDF's scale, enabling accurate measurements.

![](https://653871032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgjsBtuYmcKhWOdM9VCg4%2Fuploads%2Fgit-blob-fc63a231fa99a3e1c5d508280b8c631570c3ad84%2F648d24fa4021ee226ccdbedfa3c5a1caf792b292-320x692.gif?alt=media)
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/xamarin/measurement/measurement-tools.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
