Skip to content

Commit 403ef52

Browse files
author
GowthamPonrajSF5414
authored
Merge branch 'hotfix/hotfix-v32.2.3' into 997915-ReadColumn
2 parents d28b734 + 4e2f568 commit 403ef52

31 files changed

Lines changed: 2787 additions & 736 deletions

Document-Processing-toc.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@
884884
</li>
885885
</ul>
886886
</li>
887-
<li>
887+
<li>
888888
<a href="/document-processing/pdf/pdf-viewer/react/overview">React</a>
889889
<ul>
890890
<li>
@@ -975,6 +975,16 @@
975975
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/annotation-types/rectangle-annotation">Rectangle</a></li>
976976
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/annotation-types/circle-annotation">Circle</a></li>
977977
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/annotation-types/polygon-annotation">Polygon</a></li>
978+
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/annotation-types/ink-annotation">Ink</a></li>
979+
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/annotation-types/stamp-annotation">Stamp</a></li>
980+
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/annotation-types/sticky-notes">Sticky Notes</a></li>
981+
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/annotation-types/redaction-annotation">Redaction</a></li>
982+
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/annotation-types/free-text-annotation">Free Text</a></li>
983+
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/annotation-types/distance-annotation">Distance</a></li>
984+
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/annotation-types/perimeter-annotation">Perimeter</a></li>
985+
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/annotation-types/area-annotation">Area</a></li>
986+
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/annotation-types/radius-annotation">Radius</a></li>
987+
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/annotation-types/volume-annotation">Volume</a></li>
978988
</ul>
979989
</li>
980990
<li><a href="/document-processing/pdf/pdf-viewer/react/annotation/text-markup-annotation">Text Markup Annotation</a></li>
Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
---
2+
layout: post
3+
title: Add Area Measurement Annotations in React PDF Viewer | Syncfusion
4+
description: Learn how to enable, draw, customize, and manage Area measurement annotations in the Syncfusion React PDF Viewer.
5+
platform: document-processing
6+
control: PDF Viewer
7+
documentation: ug
8+
domainurl: ##DomainURL##
9+
---
10+
11+
# Add Area Measurement Annotations in React PDF Viewer
12+
Area is a measurement annotation used to calculate the surface of a closed region on a PDF page—ideal for engineering, construction, or design reviews.
13+
14+
![Area overview](../../../javascript-es6/annotations/annotation-images/area-annot.png)
15+
16+
## Enable Area Measurement
17+
18+
To enable Area annotations, inject the following modules into the React PDF Viewer:
19+
20+
- [**Annotation**](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#annotation)
21+
- [**Toolbar**](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#toolbar)
22+
23+
{% tabs %}
24+
{% highlight js tabtitle="Standalone" %}
25+
{% raw %}
26+
import * as React from 'react';
27+
import * as ReactDOM from 'react-dom/client';
28+
import { PdfViewerComponent, Inject, Toolbar, Annotation } from '@syncfusion/ej2-react-pdfviewer';
29+
30+
function App() {
31+
return (
32+
<PdfViewerComponent
33+
id="container"
34+
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
35+
resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib"
36+
style={{ height: '650px' }}
37+
>
38+
<Inject services={[Toolbar, Annotation]} />
39+
</PdfViewerComponent>
40+
);
41+
}
42+
43+
ReactDOM.createRoot(document.getElementById('sample')).render(<App />);
44+
{% endraw %}
45+
{% endhighlight %}
46+
{% endtabs %}
47+
48+
## Add Area Annotation
49+
50+
### Add Area Using the Toolbar
51+
52+
1. Open the **Annotation Toolbar**.
53+
2. Select **Measurement****Area**.
54+
3. Click points to define the polygon; double‑click to close and finalize the area.
55+
56+
![Measurement toolbar](../../images/calibrate_tool.png)
57+
58+
> **Tip:** If Pan mode is active, choosing a measurement tool switches the viewer into the appropriate interaction mode for a smoother workflow.
59+
60+
### Enable Area Mode
61+
Programmatically switch the viewer into Area mode.
62+
63+
{% tabs %}
64+
{% highlight js tabtitle="Standalone" %}
65+
{% raw %}
66+
function enableAreaMode() {
67+
const viewer = document.getElementById('container').ej2_instances[0];
68+
viewer.annotation.setAnnotationMode('Area');
69+
}
70+
{% endraw %}
71+
{% endhighlight %}
72+
{% endtabs %}
73+
74+
#### Exit Area Mode
75+
{% tabs %}
76+
{% highlight js tabtitle="Standalone" %}
77+
{% raw %}
78+
function exitAreaMode() {
79+
const viewer = document.getElementById('container').ej2_instances[0];
80+
viewer.annotation.setAnnotationMode('None');
81+
}
82+
{% endraw %}
83+
{% endhighlight %}
84+
{% endtabs %}
85+
86+
### Add Area Programmatically
87+
Use the [`addAnnotation`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#addannotation) API to draw an area by providing **vertexPoints** for a closed region.
88+
89+
{% tabs %}
90+
{% highlight js tabtitle="Standalone" %}
91+
{% raw %}
92+
function addArea() {
93+
const viewer = document.getElementById('container').ej2_instances[0];
94+
viewer.annotation.addAnnotation('Area', {
95+
offset: { x: 200, y: 500 },
96+
pageNumber: 1,
97+
vertexPoints: [
98+
{ x: 200, y: 500 },
99+
{ x: 288, y: 499 },
100+
{ x: 289, y: 553 },
101+
{ x: 200, y: 500 }
102+
]
103+
});
104+
}
105+
{% endraw %}
106+
{% endhighlight %}
107+
{% endtabs %}
108+
109+
## Customize Area Appearance
110+
Configure default properties using the [`Area Settings`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#areasettings) property (for example, default **fill color**, **stroke color**, **opacity**).
111+
112+
{% tabs %}
113+
{% highlight js tabtitle="Standalone" %}
114+
{% raw %}
115+
<PdfViewerComponent
116+
id="container"
117+
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
118+
resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib"
119+
areaSettings={{ fillColor: 'yellow', strokeColor: 'orange', opacity: 0.6 }}
120+
style={{ height: '650px' }}
121+
>
122+
<Inject services={[Toolbar, Annotation]} />
123+
</PdfViewerComponent>
124+
{% endraw %}
125+
{% endhighlight %}
126+
{% endtabs %}
127+
128+
## Manage Area (Move, Reshape, Edit, Delete)
129+
- **Move**: Drag inside the polygon to reposition it.
130+
- **Reshape**: Drag any vertex handle to adjust points and shape.
131+
132+
### Edit Perimeter
133+
134+
#### Edit Perimeter (UI)
135+
136+
- Edit the **fill color** using the Edit Color tool.
137+
![Fill color](../../images/calibrate_fillcolor.png)
138+
- Edit the **stroke color** using the Edit Stroke Color tool.
139+
![Stroke color](../../images/calibrate_stroke.png)
140+
- Edit the **border thickness** using the Edit Thickness tool.
141+
![Thickness](../../images/calibrate_thickness.png)
142+
- Edit the **opacity** using the Edit Opacity tool.
143+
![Opacity](../../images/calibrate_opacity.png)
144+
- Open **Right Click → Properties** for additional line‑based options.
145+
![Line properties](../../images/calibrate_lineprop.png)
146+
147+
#### Edit Area Programmatically
148+
149+
Update properties and call `editAnnotation()`.
150+
151+
{% tabs %}
152+
{% highlight js tabtitle="Standalone" %}
153+
{% raw %}
154+
function editAreaProgrammatically() {
155+
const viewer = document.getElementById('container').ej2_instances[0];
156+
for (const ann of viewer.annotationCollection) {
157+
if (ann.subject === 'Area calculation') {
158+
ann.strokeColor = '#0000FF';
159+
ann.thickness = 2;
160+
ann.fillColor = '#FFFF00';
161+
viewer.annotation.editAnnotation(ann);
162+
break;
163+
}
164+
}
165+
}
166+
{% endraw %}
167+
{% endhighlight %}
168+
{% endtabs %}
169+
170+
### Delete Distance Annotation
171+
172+
Delete Distance Annotation via UI (toolbar/context menu) or programmatically. For supported workflows and APIs, see [**Delete Annotation**](../remove-annotations).
173+
174+
## Set Default Properties During Initialization
175+
Apply defaults for Area using the [`areaSettings`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#areasettings) property.
176+
177+
{% tabs %}
178+
{% highlight js tabtitle="Standalone" %}
179+
{% raw %}
180+
<PdfViewerComponent
181+
id="container"
182+
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
183+
resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib"
184+
areaSettings={{ fillColor: 'yellow', strokeColor: 'orange', opacity: 0.6 }}
185+
style={{ height: '650px' }}
186+
>
187+
<Inject services={[Toolbar, Annotation]} />
188+
</PdfViewerComponent>
189+
{% endraw %}
190+
{% endhighlight %}
191+
{% endtabs %}
192+
193+
## Set Properties While Adding Individual Annotation
194+
Pass per‑annotation values directly when calling [`addAnnotation`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#addannotation).
195+
196+
{% tabs %}
197+
{% highlight js tabtitle="Standalone" %}
198+
{% raw %}
199+
function addStyledArea() {
200+
const viewer = document.getElementById('container').ej2_instances[0];
201+
viewer.annotation.addAnnotation('Area', {
202+
offset: { x: 210, y: 510 },
203+
pageNumber: 1,
204+
vertexPoints: [
205+
{ x: 210, y: 510 },
206+
{ x: 300, y: 510 },
207+
{ x: 305, y: 560 },
208+
{ x: 210, y: 510 }
209+
],
210+
strokeColor: '#EA580C',
211+
fillColor: '#FEF3C7',
212+
thickness: 2,
213+
opacity: 0.85
214+
});
215+
}
216+
{% endraw %}
217+
{% endhighlight %}
218+
{% endtabs %}
219+
220+
## Scale Ratio and Units
221+
- Use **Scale Ratio** from the context menu to set the actual‑to‑page scale.
222+
![Scale ratio](../../images/calibrate_scaleratio.png)
223+
- Supported units include **Inch, Millimeter, Centimeter, Point, Pica, Feet**.
224+
![Scale dialog](../../images/calibrate_scaledialog.png)
225+
226+
### Set Default Scale Ratio During Initialization
227+
Configure scale defaults using [`measurementSettings`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#mesaurementsettings).
228+
229+
{% tabs %}
230+
{% highlight js tabtitle="Standalone" %}
231+
{% raw %}
232+
<PdfViewerComponent
233+
id="container"
234+
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
235+
resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib"
236+
measurementSettings={{ scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm' }}
237+
style={{ height: '650px' }}
238+
>
239+
<Inject services={[Toolbar, Annotation]} />
240+
</PdfViewerComponent>
241+
{% endraw %}
242+
{% endhighlight %}
243+
{% endtabs %}
244+
245+
## Handle Area Events
246+
247+
Listen to annotation life-cycle events (add/modify/select/remove). For the full list and parameters, see [**Annotation Events**](../annotation-event).
248+
249+
## Export and Import
250+
Area measurements can be exported or imported with other annotations. For workflows and supported formats, see [**Export and Import annotations**](../export-import-annotations).
251+
252+
## See Also
253+
- [Annotation Toolbar](../../toolbar-customization/annotation-toolbar)
254+
- [Customize Context Menu](../../context-menu/custom-context-menu)
255+
- [Comments Panel](../comments)
256+
- [Annotation Events](../annotation-event)
257+
- [Export and Import annotations](../export-import-annotations)
258+
- [Delete Annotations](../remove-annotations)

Document-Processing/PDF/PDF-Viewer/react/annotation/annotation-types/arrow-annotation.md

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ Arrow annotations let users point, direct attention, or indicate flow on PDFs—
1313

1414
![Arrow overview](../../../javascript-es6/annotations/annotation-images/arrow-annot.png)
1515

16-
---
17-
1816
## Enable Arrow Annotation in the Viewer
1917

2018
To enable Arrow annotations, inject the following modules into the React PDF Viewer:
@@ -47,11 +45,9 @@ ReactDOM.createRoot(document.getElementById('sample')).render(<App />);
4745
{% endhighlight %}
4846
{% endtabs %}
4947

50-
---
51-
52-
## Apply Arrow Annotation
48+
## Add Arrow Annotation
5349

54-
### Apply Arrow Annotation Using the Toolbar
50+
### Add Arrow Annotation Using the Toolbar
5551
1. Open the **Annotation Toolbar**.
5652
2. Select **Shapes****Arrow**.
5753
3. Click and drag on the PDF page to draw the arrow.
@@ -60,8 +56,6 @@ ReactDOM.createRoot(document.getElementById('sample')).render(<App />);
6056

6157
N> When in Pan mode, selecting a shape tool automatically switches the viewer to selection mode for smooth interaction.
6258

63-
---
64-
6559
### Enable Arrow Mode
6660
Switch the viewer into highlight mode using `setAnnotationMode('Arrow')`.
6761

@@ -88,8 +82,6 @@ function exitArrowMode() {
8882
{% endhighlight %}
8983
{% endtabs %}
9084

91-
---
92-
9385
### Add Arrow Programmatically
9486
Use the [`addAnnotation`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#addannotation) API to draw an arrow at a specific location (defined by two **vertexPoints**).
9587

@@ -111,8 +103,6 @@ function addArrow() {
111103
{% endhighlight %}
112104
{% endtabs %}
113105

114-
---
115-
116106
## Customize Arrow Appearance
117107
Configure default arrow appearance (fill color, stroke color, thickness, opacity) using the [`arrowSettings`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#arrowsettings) property.
118108

@@ -134,8 +124,6 @@ Configure default arrow appearance (fill color, stroke color, thickness, opacity
134124

135125
N> For **Line** and **Arrow** annotations, **Fill Color** is available only when an arrowhead style is applied at the **Start** or **End**. If both are `None`, lines do not render fill and the Fill option remains disabled.
136126

137-
---
138-
139127
## Manage Arrow (Edit, Move, Resize, Delete)
140128
### Edit Arrow
141129

@@ -181,21 +169,15 @@ function editArrowProgrammatically() {
181169
{% endhighlight %}
182170
{% endtabs %}
183171

184-
---
185-
186172
### Delete Arrow
187173

188174
The PDF Viewer supports deleting existing annotations through the UI and API.
189175
See [**Delete Annotation**](../remove-annotations) for full behavior and workflows.
190176

191-
---
192-
193177
### Comments
194178

195179
Use the [**Comments panel**](../comments) to add, view, and reply to threaded discussions linked to arrow annotations. It provides a dedicated interface for collaboration and review within the PDF Viewer.
196180

197-
---
198-
199181
## Set properties while adding Individual Annotation
200182

201183
Set properties for individual arrow annotations by passing values directly during [`addAnnotation`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#addannotation).
@@ -240,8 +222,6 @@ function addMultipleArrows() {
240222
{% endhighlight %}
241223
{% endtabs %}
242224

243-
---
244-
245225
## Disable Arrow Annotation
246226

247227
Disable shape annotations (Line, Arrow, Rectangle, Circle, Polygon) using the [`enableShapeAnnotation`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#enableshapeannotation) property.
@@ -262,20 +242,14 @@ Disable shape annotations (Line, Arrow, Rectangle, Circle, Polygon) using the [`
262242
{% endhighlight %}
263243
{% endtabs %}
264244

265-
---
266-
267245
## Handle Arrow Events
268246

269247
The PDF viewer provides annotation life-cycle events that notify when Arrow annotations are added, modified, selected, or removed.
270248
For the full list of available events and their descriptions, see [**Annotation Events**](../annotation-event)
271249

272-
---
273-
274250
## Export and Import
275251
The PDF Viewer supports exporting and importing annotations. For details on supported formats and workflows, see [**Export and Import annotations**](../export-import-annotations).
276252

277-
---
278-
279253
## See Also
280254
- [Annotation Toolbar](../../toolbar-customization/annotation-toolbar)
281255
- [Customize Context Menu](../../context-menu/custom-context-menu)

0 commit comments

Comments
 (0)