Skip to content

Commit 7da6507

Browse files
1009405: UG Revamp in JS II
1 parent 687c385 commit 7da6507

81 files changed

Lines changed: 896 additions & 878 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-event.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ documentation: ug
77
domainurl: ##DomainURL##
88
---
99

10-
# Annotations Events in JavaScript Pdf viewer control
10+
# Annotation events in JavaScript PDF Viewer
1111

12-
The PDF Viewer component triggers various events based on user interactions and changes in the component's state. These events can be used to perform actions when a specific event occurs. This section describes the events available in the PDF Viewer component.
12+
This page documents annotation-related events for the JavaScript PDF Viewer and when to use them. The PDF Viewer triggers events for user interactions and component state changes; use these events to run handlers that respond to specific occurrences. The sections below list each event, the associated event-args type, and an example handler.
1313

1414
| Event | Description |
1515
| ------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-permission.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ domainurl: ##DomainURL##
1010

1111
# Annotation permissions in JavaScript PDF Viewer
1212

13-
Use [annotationSettings](https://ej2.syncfusion.com/documentation/api/pdfviewer/index-default#annotationsettings) to control creation-time permissions and behavior of annotations in the PDF Viewer.
13+
Use [annotationSettings](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#annotationsettings) to control creation-time permissions and default behavior for annotations in the PDF Viewer. These settings establish defaults for annotations created through the UI and programmatic flows.
1414

1515
## Common permissions
1616

17-
- isLock: Locks the annotation so it cannot be moved, resized, edited, or deleted.
18-
- skipPrint: Excludes annotations from the print output when the document is printed from the viewer.
19-
- skipDownload: Excludes annotations from the exported/downloaded document.
17+
- `isLock`: Lock an annotation so it cannot be moved, resized, edited, or deleted.
18+
- `skipPrint`: Exclude annotations from the print output when printing from the viewer.
19+
- `skipDownload`: Exclude annotations from the exported/downloaded PDF.
20+
21+
Example: inject modules and create a viewer instance with default `annotationSettings`.
2022

2123
```js
2224
// Ensure you have included the required EJ2 PDF Viewer scripts and styles via CDN before this script
@@ -61,8 +63,10 @@ viewer.appendTo('#pdfViewer');
6163

6264
## Individual permissions
6365

64-
- isPrint: Controls whether a specific annotation participates in printing. Set to false to prevent just that annotation from printing.
65-
- isLock: You can also lock/unlock a specific annotation instance programmatically.
66+
- `isPrint`: Controls whether a specific annotation participates in printing. Set to `false` to exclude only that annotation from print output.
67+
- `isLock`: Lock or unlock a specific annotation instance programmatically.
68+
69+
Example: create a viewer instance with per-annotation defaults for text markup, shapes, and measurements.
6670

6771
```js
6872
// Ensure you have included the required EJ2 PDF Viewer scripts and styles via CDN before this script

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/Squiggly-annotation.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ You can add squiggly annotations in two ways:
2727
![Squiggly context](../../../javascript-es6/annotations/annotation-images/squiggle-context.gif)
2828

2929
2. Using the annotation toolbar
30-
* Click the **Edit Annotation** button in the PDF Viewer toolbar to open the annotation toolbar.
31-
* Select **Squiggly** to enable squiggly mode.
32-
* Select text to add the squiggly annotation.
33-
* Alternatively, select text first and then click **Squiggly**.
30+
- Click the **Edit Annotation** button in the PDF Viewer toolbar to open the annotation toolbar.
31+
- Select **Squiggly** to enable squiggly mode.
32+
- Select text to add a squiggly annotation.
33+
- Alternatively, select text first and then click **Squiggly**.
3434

3535
![Squiggly toolbar](../../../javascript-es6/annotations/annotation-images/squiggle-tool.gif)
3636

3737
N> When in pan mode, selecting a text markup annotation switches the PDF Viewer to text select mode.
3838

39-
### Enable Squiggly Mode
39+
### Enable squiggly mode
4040

41-
Enable/exit squiggly mode using the following code:
41+
Enable or exit squiggly mode using the following code:
4242

4343
```html
4444
<button id="squigglyMode">Squiggly</button>
@@ -107,7 +107,7 @@ document.getElementById('setNone').addEventListener('click', function () {
107107
{% endhighlight %}
108108
{% endtabs %}
109109

110-
### Add squiggly annotation programmatically
110+
### Add squiggly annotations programmatically
111111

112112
Add squiggly annotations programmatically using the [addAnnotation](https://ej2.syncfusion.com/documentation/api/pdfviewer/annotation#addannotation) method.
113113

@@ -175,11 +175,11 @@ document.getElementById('addSquiggly').addEventListener('click', function () {
175175
{% endhighlight %}
176176
{% endtabs %}
177177

178-
## Edit Squiggly Annotation
178+
## Edit Squiggly Annotations
179179

180-
### Edit squiggly annotation in UI
180+
### Edit squiggly annotations in UI
181181

182-
You can select and delete squiggly annotations directly in the viewer. Use the context menu or toolbar options as needed.
182+
Use the viewer to select and delete squiggly annotations. Use the context menu or toolbar options as needed.
183183

184184
Delete the selected annotation in the following ways:
185185

@@ -195,7 +195,7 @@ Delete the selected annotation in the following ways:
195195

196196
#### Edit squiggly annotation properties in UI
197197

198-
The color and opacity of the squiggly annotation can be edited using the Edit Color and Edit Opacity tools in the annotation toolbar.
198+
The color and opacity of squiggly annotations can be edited using the Edit Color and Edit Opacity tools in the annotation toolbar.
199199

200200
- Edit color: Use the color palette in the Edit Color tool to change the annotation color.
201201

@@ -286,7 +286,7 @@ document.getElementById('editSquiggly').addEventListener('click', function () {
286286

287287
Set default properties before creating the control using `squigglySettings`.
288288

289-
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
289+
N> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
290290

291291
{% tabs %}
292292
{% highlight js tabtitle="Standalone" %}
@@ -332,11 +332,11 @@ pdfviewer.appendTo('#PdfViewer');
332332

333333
## Set properties while adding Individual Annotation
334334

335-
Set properties for individual annotation before creating the control using `SquigglySettings`.
335+
Set properties for individual annotations before creating the control using `SquigglySettings`.
336336

337-
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
337+
N> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
338338

339-
Refer to the following code snippet to set the default highlight settings.
339+
Refer to the following code snippet to set the default squiggly settings.
340340

341341
```html
342342
<button id="squiggly">Add Squiggly</button>

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/area-annotation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Area is a measurement annotation used to measure the surface of a closed region
1818

1919
### Add area annotation via UI
2020

21-
Use the annotation toolbar:
21+
- Use the annotation toolbar to:
2222
- Click the **Edit Annotation** button in the PDF Viewer toolbar.
2323
- Click the **Measurement Annotation** dropdown.
2424
- Choose **Area**, then draw the region on the page.
@@ -348,9 +348,9 @@ pdfviewer.appendTo('#PdfViewer');
348348

349349
## Set properties while adding Individual Annotation
350350

351-
Set properties for individual annotation before creating the control using `AreaSettings`.
351+
Set properties for individual annotations before creating the control using `AreaSettings`.
352352

353-
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
353+
N> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
354354

355355
Refer to the following code snippet to set the default Area settings.
356356

@@ -434,7 +434,7 @@ The scale ratio and unit of measurement can be modified using the scale ratio op
434434

435435
![CalibrateScaleRatio](../../images/calibrate_scaleratio.png)
436436

437-
The Units of measurements support for the measurement annotations in the PDF Viewer are
437+
Supported units for measurement annotations are
438438

439439
* Inch
440440
* Millimeter

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/arrow-annotation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Arrow is a shape annotation used to point, direct attention, or indicate flow. C
1818

1919
### Add arrow annotation via UI
2020

21-
Use the annotation toolbar:
21+
Use the annotation toolbar to:
2222
- Click the **Edit Annotation** button in the PDF Viewer toolbar.
23-
- Open the **Shape Annotation**** dropdown.
23+
- Open the **Shape Annotation** dropdown.
2424
- Choose **Arrow**, then draw on the page.
2525

2626
N> When in pan mode, selecting a shape annotation switches the viewer to text select mode.
@@ -335,9 +335,9 @@ pdfviewer.appendTo('#PdfViewer');
335335

336336
## Set properties while adding Individual Annotation
337337

338-
Set properties for individual annotation before creating the control using `ArrowSettings`.
338+
Set properties for individual annotations before creating the control using `ArrowSettings`.
339339

340-
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
340+
N> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
341341

342342
Refer to the following code snippet to set the default arrow settings.
343343

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/circle-annotation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Circle is a shape annotation used to highlight circular regions or draw emphasis
1818

1919
### Add circle annotation via UI
2020

21-
Use the annotation toolbar:
21+
Use the annotation toolbar to:
2222
- Click the **Edit Annotation** button in the PDF Viewer toolbar.
2323
- Open the **Shape Annotation** dropdown.
2424
- Choose **Circle**, then draw on the page.
@@ -29,7 +29,7 @@ N> When in pan mode, selecting a shape annotation switches the viewer to text se
2929

3030
### Enable circle mode
3131

32-
The PDF Viewer library allows drawing Circle annotations programmatically after enabling Circle mode in button clicks.
32+
The PDF Viewer library allows drawing circle annotations programmatically after enabling circle mode via button clicks.
3333

3434
```html
3535
<button id="circleMode">Circle</button>
@@ -350,9 +350,9 @@ pdfviewer.appendTo('#PdfViewer');
350350

351351
## Set properties while adding Individual Annotation
352352

353-
Set properties for individual annotation before creating the control using `CircleSettings`.
353+
Set properties for individual annotations before creating the control using `CircleSettings`.
354354

355-
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
355+
N> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
356356

357357
Refer to the following code snippet to set the default Circle settings.
358358

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/distance-annotation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Distance is a measurement annotation used to measure the length between two poin
1818

1919
### Add distance annotation via UI
2020

21-
Use the annotation toolbar:
21+
Use the annotation toolbar to:
2222
- Click the **Edit Annotation** button in the PDF Viewer toolbar.
2323
- Open the **Measurement Annotation** dropdown.
2424
- Choose **Distance**, then draw on the page.
@@ -29,7 +29,7 @@ N> When in pan mode, selecting a measurement annotation switches the viewer to t
2929

3030
### Enable distance mode
3131

32-
The PDF Viewer component allows drawing Distance annotations programmatically after enabling Distance mode in button clicks.
32+
The PDF Viewer component allows drawing distance annotations programmatically after enabling distance mode via button clicks.
3333

3434
```html
3535
<button id="distanceMode">Distance</button>
@@ -181,7 +181,7 @@ You can select, move, and resize Distance annotations directly in the viewer:
181181
- Resize: drag the end handles to adjust its length.
182182
- Delete or access more options from the context menu.
183183

184-
#### Edit the properties of area annotations
184+
#### Edit the properties of distance annotations
185185

186186
The fill color, stroke color, thickness, and opacity can be edited using the Edit Color, Edit Stroke Color, Edit Thickness, and Edit Opacity tools in the annotation toolbar.
187187

@@ -337,9 +337,9 @@ pdfviewer.appendTo('#PdfViewer');
337337

338338
## Set properties while adding Individual Annotation
339339

340-
Set properties for individual annotation before creating the control using `DistanceSettings`.
340+
Set properties for individual annotations before creating the control using `DistanceSettings`.
341341

342-
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
342+
N> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
343343

344344
Refer to the following code snippet to set the default Distance settings.
345345

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/free-text-annotation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ Free Text is a text box annotation used to place formatted text anywhere on the
1818

1919
### Add Free Text annotation via UI
2020

21-
Use the annotation toolbar:
21+
Use the annotation toolbar to:
2222
- Click the **Edit Annotation** button in the PDF Viewer toolbar.
2323
- Click the **Free Text Annotation** button to enable Free Text mode.
2424
- Click on the page to add text.
2525

26-
When in pan mode, selecting Free Text switches the viewer to text select mode.
26+
N> When in pan mode, selecting Free Text switches the viewer to text select mode.
2727

2828
![Free text tool in the annotation toolbar](../annotation-images/free-text-annot.png)
2929

3030
### Switch to Free Text mode
3131

32-
The PDF Viewer component allows drawing Distance annotations programmatically after enabling Distance mode in button clicks.
32+
The PDF Viewer component allows drawing free text annotations programmatically after enabling Free Text mode via button clicks.
3333

3434
```html
3535
<button id="addFreeTextAnnotation">FreeText</button>
@@ -374,9 +374,9 @@ pdfviewer.appendTo('#PdfViewer');
374374

375375
## Set properties while adding Individual Annotation
376376

377-
Set properties for individual annotation before creating the control using `FreeTextSettings`.
377+
Set properties for individual annotations before creating the control using `FreeTextSettings`.
378378

379-
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
379+
N> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
380380

381381
Refer to the following code snippet to set the default FreeText settings.
382382

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/highlight-annotation.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The PDF Viewer provides options to add, edit, and delete Highlight annotations o
1818

1919
### Add highlight annotation via UI
2020

21-
You can add highlights in two ways:
21+
Add highlights in two ways:
2222

2323
1. Using the context menu
2424
- Select text in the PDF document and right-click it.
@@ -27,17 +27,18 @@ You can add highlights in two ways:
2727
![Alt text](../../../javascript-es6/annotations/annotation-images/highlight-context.gif)
2828

2929
2. Using the annotation toolbar
30+
Use the annotation toolbar to:
3031
- Click the **Edit Annotation** button in the PDF Viewer toolbar to open the annotation toolbar.
3132
- Select **Highlight** to enable highlight mode.
32-
- Select text to add the highlight annotation. Alternatively, select text first and then click **Highlight**.
33+
- Select text to add the highlight annotation, or select text first and then click **Highlight**.
3334

3435
![Alt text](../../../javascript-es6/annotations/annotation-images/highlight-tool.gif)
3536

3637
N> When pan mode is active and a text markup mode is entered, the PDF Viewer switches to text selection mode to enable selection.
3738

3839
### Switch to Highlight Mode
3940

40-
The PDF Viewer component allows add highlight annotations programmatically after enabling Highlight mode in button clicks.
41+
The PDF Viewer component allows adding highlight annotations programmatically after enabling Highlight mode via button clicks.
4142

4243
```html
4344
<!--Element to set text markup annotation mode-->
@@ -187,7 +188,7 @@ document.getElementById('highlight').addEventListener('click', function () {
187188

188189
### Edit highlight annotation in UI
189190

190-
You can select a highlight to change its appearance or remove it:
191+
Select a highlight to change its appearance or remove it:
191192
- Change appearance using the annotation toolbar: Edit Color and Edit Opacity.
192193
- Delete using Delete/Backspace keys or the Delete Annotation button in the annotation toolbar.
193194

@@ -288,7 +289,7 @@ document.getElementById('editHighlight').addEventListener('click', function () {
288289

289290
Set default properties before creating the control using `highlightSettings`.
290291

291-
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
292+
N> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
292293

293294
Refer to the following code snippet to set the default highlight settings.
294295

@@ -335,9 +336,9 @@ pdfviewer.appendTo('#PdfViewer');
335336

336337
## Set properties while adding Individual Annotation
337338

338-
Set properties for individual annotation before creating the control using `highlightSettings`.
339+
Set properties for individual annotations before creating the control using `highlightSettings`.
339340

340-
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
341+
N> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
341342

342343
Refer to the following code snippet to set the default highlight settings.
343344

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/ink-annotation.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ Ink is a freehand drawing annotation used to sketch, sign, or mark up content.
1818

1919
### Add ink annotation via UI
2020

21-
Use the annotation toolbar:
22-
- Click the Edit Annotation button in the PDF Viewer toolbar.
23-
- Click the Draw Ink button to enable ink mode.
21+
Use the annotation toolbar to:
22+
- Click the **Edit Annotation** button in the PDF Viewer toolbar.
23+
- Click the **Draw Ink** button to enable ink mode.
2424
- Draw on any page of the PDF document.
2525

2626
![Ink tool in the annotation toolbar](../../images/ink_tool.png)
2727

2828
### Enable ink mode
2929

30-
The PDF Viewer component allows add ink annotations programmatically after enabling ink mode in button clicks.
30+
The PDF Viewer component allows adding ink annotations programmatically after enabling ink mode via button clicks.
3131

3232
```html
3333
<button id="addInkAnnotation">Ink Annotation</button>
@@ -157,7 +157,7 @@ document.getElementById('addInkAnnotationProgram').addEventListener('click', fun
157157

158158
### Edit ink annotation in UI
159159

160-
You can select, move, and resize Ink annotations directly in the viewer:
160+
Select, move, and resize ink annotations directly in the viewer:
161161
- Select an Ink annotation to show its handles.
162162
- Move: drag inside the stroke to reposition it on the page.
163163
- Resize: drag the selector handles to adjust its bounds.
@@ -323,9 +323,9 @@ pdfviewer.appendTo('#PdfViewer');
323323

324324
## Set properties while adding Individual Annotation
325325

326-
Set properties for individual annotation before creating the control using `InkSettings`.
326+
Set properties for individual annotations before creating the control using `InkSettings`.
327327

328-
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
328+
N> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
329329

330330
Refer to the following code snippet to set the default Ink settings.
331331

0 commit comments

Comments
 (0)