> 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/ios/measurement/measurement-tools-i.md).

# Customize the PDF Measurement Tool on iOS

Learn how to use PDF documents for precise measurements with line, polyline, and polygon annotations. Discover how the Apryse iOS SDK simplifies creating and modifying annotations with built-in tools

## 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](#overview) 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://4149080208-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgY6xtY9ZQd9XMpvWlGM0%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://4149080208-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgY6xtY9ZQd9XMpvWlGM0%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://4149080208-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgY6xtY9ZQd9XMpvWlGM0%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:

{% tabs %}
{% tab title="Swift" %}
{% code lineNumbers="true" %}

```swift
// Enable end-point snapping for measurement tools
self.toolManager.isSnapToDocumentGeometryEnabled = true
```

{% endcode %}
{% endtab %}

{% tab title="Obj-C" %}
{% code lineNumbers="true" %}

```objc
// Enable end-point snapping for measurement tools
self.toolManager.isSnapToDocumentGeometryEnabled = YES;
```

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

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://4149080208-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgY6xtY9ZQd9XMpvWlGM0%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://4149080208-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgY6xtY9ZQd9XMpvWlGM0%2Fuploads%2Fgit-blob-fc63a231fa99a3e1c5d508280b8c631570c3ad84%2F648d24fa4021ee226ccdbedfa3c5a1caf792b292-320x692.gif?alt=media)


---

# 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/ios/measurement/measurement-tools-i.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.
