# Measure Area in a PDF Using JavaScript

Measure area in a PDF using PSPDFKit for Web starting with version 2022.5. To measure area in your app, contact the Sales team to add the Measurement Tools component to your license, or run the SDK in trial mode.

Measure area in one of the following ways:

## Measuring the Area of a Polygon

Measure the area of a custom-drawn polygon in one of the following ways:

### Measuring the Area of a Polygon Using the Built-In UI

To measure the area of a polygon using the built-in UI, follow these steps:

1. Click the measurement tools icon.

2. Tap Polygon Area.

3. Draw a polygon around the area you want to measure.

### Measuring the Area of a Polygon Programmatically

To measure the area of a polygon programmatically, use the `PolygonAnnotation` shape constructor, which takes a `measurementScale` property and a `measurementPrecision` property as its parameters. For more information on scale and precision, see the guide on configuring measurements.

## Measuring the Area of an Ellipse

Measure the area of an ellipse in one of the following ways:

### Measuring the Area of an Ellipse Using the Built-In UI

To measure the area of an ellipse using the built-in UI, follow these steps:

1. Click the measurement tools icon.

2. Tap Ellipse Area.

3. Draw an ellipse around the area you want to measure.

### Measuring the Area of an Ellipse Programmatically

To measure the area of an ellipse programmatically, use the `CircleAnnotation` shape constructor, which takes a `measurementScale` property and a `measurementPrecision` property as its parameters. For more information on scale and precision, see the guide on configuring measurements.

## Measuring the Area of a Rectangle

Measure the area of a rectangle in one of the following ways:

### Measuring the Area of a Rectangle Using the Built-In UI

To measure the area of a rectangle using the built-in UI, follow these steps:

1. Click the measurement tools icon.

2. Tap Rectangle Area.

3. Draw a rectangle around the area you want to measure.

### Measuring the Area of a Rectangle Programmatically

To measure the area of a rectangle programmatically, use the `SquareAnnotation` shape constructor, which takes a `measurementPrecision` property and a `measurementPrecision` property as its parameters. For more information on scale and precision, see the guide on configuring measurements.

## Configuring Measurements

For more information on configuring measurements, see the guide on configuring measurements.