---
title: "measure.setSnap: Snap a measurement vertex — PDF kit command — Kition"
description: "Snap a point to vector paths, endpoints, midpoints or intersections. Coordinates and tolerance are in display points. Bounded extraction reports truncated geometry."
canonical: "https://developer.kition.ai/docs/kits/pdf/commands/measure.setSnap"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/pdf/commands/measure.setSnap](https://developer.kition.ai/docs/kits/pdf/commands/measure.setSnap)

# measure.setSnap

**Snap a measurement vertex.** Snap a point to vector paths, endpoints, midpoints or intersections. Coordinates and tolerance are in display points. Bounded extraction reports truncated geometry.

- Kit: PDF 0.1.0 (.pdf); reference: [PDF kit commands](https://developer.kition.ai/docs/kits/pdf.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `at` | `number[]` | yes | [x, y] in points from the top-left of the displayed page. (maxItems 2, minItems 2) |
| `endpoints` | `boolean` | no |  |
| `intersections` | `boolean` | no |  |
| `midpoints` | `boolean` | no |  |
| `page` | `integer` | yes | (minimum 1) |
| `tolerance` | `number` | no | (maximum 10000, minimum 0) |

## Call through pdf_run

```text
pdf_run {
  "path": "<file>.pdf",
  "steps": [{ "command": "measure.setSnap", "params": { "at": <number[]>, "page": <integer> } }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `endpoints`, `intersections`, `midpoints`, `tolerance`. pdf_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `intersection_limited` | `boolean` | no |  |
| `segments` | `number` | no |  |
| `snap` | `object` | no |  |
| `truncated` | `boolean` | no |  |

```json
{
  "additionalProperties": true,
  "properties": {
    "intersection_limited": {
      "type": "boolean"
    },
    "segments": {
      "type": "number"
    },
    "snap": {
      "additionalProperties": true,
      "properties": {
        "distance": {
          "type": "number"
        },
        "kind": {
          "type": "string"
        },
        "point": {
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "truncated": {
      "type": "boolean"
    }
  },
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "at": {
      "description": "[x, y] in points from the top-left of the displayed page. (maxItems 2, minItems 2)",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "endpoints": {
      "type": "boolean"
    },
    "intersections": {
      "type": "boolean"
    },
    "midpoints": {
      "type": "boolean"
    },
    "page": {
      "description": "(minimum 1)",
      "type": "integer"
    },
    "tolerance": {
      "description": "(maximum 10000, minimum 0)",
      "type": "number"
    }
  },
  "required": [
    "at",
    "page"
  ],
  "type": "object"
}
```

Generated from the command list of @kition/pdf-darwin-arm64@0.1.0 and the kit itself (pdf_commands through @kition/cli@0.1.1, built from KitionAI/kition-pdf@b0d2725).
