Skip to content

Commit 1a09d61

Browse files
1009405: Updated UG revamp TS II
1 parent f3ac656 commit 1a09d61

70 files changed

Lines changed: 487 additions & 469 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-es6/annotations/create-modify-annotation.md

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

1111
# Create and modify annotations
1212

13-
Use the PDF Viewer annotation tools to add, edit, and manage markups across your documents. This page provides a quick overview with convenient navigation to each annotation type and common ways to create and modify annotations.
13+
The PDF Viewer annotation tools add, edit, and manage markups across documents. This page provides an overview with quick navigation to each annotation type and common creation and modification workflows.
1414

1515
## Quick navigation to annotation types
1616

1717
Jump directly to a specific annotation type for detailed usage and examples:
1818

19-
TextMarkup Annotations:
19+
TextMarkup annotations:
2020

21-
- Highlight : [Highlight annotation](./annotation-types/highlight-annotation)
21+
- Highlight: [Highlight annotation](./annotation-types/highlight-annotation)
2222
- Strikethrough: [Strikethrough annotation](./annotation-types/strikethrough-annotation)
2323
- Underline: [Underline annotation](./annotation-types/underline-annotation)
2424
- Squiggly: [Squiggly annotation](./annotation-types/Squiggly-annotation)
2525

26-
Shape Annotations:
26+
Shape annotations:
2727

2828
- Line: [Line annotation](./annotation-types/line-annotation)
2929
- Arrow: [Arrow annotation](./annotation-types/arrow-annotation)
3030
- Rectangle: [Rectangle annotation](./annotation-types/rectangle-annotation)
3131
- Circle : [Circle annotation](./annotation-types/circle-annotation)
3232
- Polygon: [Polygon annotation](./annotation-types/polygon-annotation)
3333

34-
Measurement Annotations:
34+
Measurement annotations:
3535

3636
- Distance: [Distance annotation](./annotation-types/distance-annotation)
3737
- Perimeter: [Perimeter annotation](./annotation-types/perimeter-annotation)
3838
- Area: [Area annotation](./annotation-types/area-annotation)
3939
- Radius: [Radius annotation](./annotation-types/ra)
4040
- Volume: [Volume annotation](./annotation-types/vo)
4141

42-
Other Annotations:
42+
Other annotations:
4343

4444
- Redaction: [Redaction annotation](./annotation-types/redaction-annotation)
4545
- Free Text: [Free text annotation](./annotation-types/free-text-annotation)
@@ -54,18 +54,18 @@ N> Each annotation type page includes both UI steps and programmatic examples sp
5454
### Create via UI
5555

5656
- Open the annotation toolbar in the PDF Viewer.
57-
- Choose the required tool (for example, Shape, Free Text, Ink, Stamp, Redaction).
57+
- Choose the required tool (for example, Shape, Free text, Ink, Stamp, Redaction).
5858
- Click or drag on the page to place the annotation.
5959

6060
![Annotation toolbar](../images/shape_toolbar.png)
6161

62-
Notes:
63-
- When pan mode is active and you select a shape or stamp tool, the viewer switches to text select mode automatically.
64-
- Property pickers in the annotation toolbar let you choose color, stroke color, thickness, and opacity while drawing.
62+
Note:
63+
- When pan mode is active and a shape or stamp tool is selected, the viewer switches to text select mode automatically.
64+
- Property pickers in the annotation toolbar let users choose color, stroke color, thickness, and opacity while drawing
6565

6666
### Create programmatically
6767

68-
Creation patterns vary slightly by type. Refer to the type pages above for tailored code. Example: creating a Redaction annotation using addAnnotation.
68+
Creation patterns vary by type. Refer to the individual annotation pages for tailored code. Example: creating a Redaction annotation using `addAnnotation`.
6969

7070
```html
7171
<button id="addRedactAnnot">Add Redaction Annotation</button>
@@ -88,31 +88,31 @@ document.getElementById('addRedactAnnot')?.addEventListener('click', () => {
8888
});
8989
```
9090

91-
See the individual annotation pages (links above) for enabling draw modes from UI buttons and other type-specific creation samples.
91+
Refer to the individual annotation pages for enabling draw modes from UI buttons and other type-specific creation samples.
9292

9393
## Modify annotations
9494

9595
### Modify via UI
9696

9797
Use the annotation toolbar after selecting an annotation:
98-
- Edit Color: change the fill or text color (when applicable)
98+
- Edit color: change the fill or text color (when applicable)
9999
![Edit color](../images/edit_color.png)
100-
- Edit Stroke Color: change the border/line color (shape and line types)
100+
- Edit stroke color: change the border or line color (shape and line types)
101101
![Edit stroke color](../images/shape_strokecolor.png)
102-
- Edit Thickness: adjust the border/line thickness
102+
- Edit thickness: adjust the border or line thickness
103103
![Edit thickness](../images/shape_thickness.png)
104-
- Edit Opacity: change transparency
104+
- Edit opacity: change transparency
105105
![Edit opacity](../images/shape_opacity.png)
106106

107107

108108
Additional options such as Line Properties (for line/arrow) are available from the context menu (right-click > Properties) where supported.
109109

110110
### Modify programmatically
111111

112-
Use editAnnotation to apply changes to an existing annotation. Common flow:
113-
- Locate the target annotation from annotationCollection
114-
- Update the desired properties
115-
- Call editAnnotation with the modified object
112+
Use `editAnnotation` to apply changes to an existing annotation. Common flow:
113+
- Locate the target annotation from `annotationCollection`.
114+
- Update the desired properties.
115+
- Call `editAnnotation` with the modified object.
116116

117117
```html
118118
<button id="bulkEdit">Bulk edit matching annotations</button>

Document-Processing/PDF/PDF-Viewer/javascript-es6/annotations/custom-data.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ domainurl: ##DomainURL##
1010

1111
# Custom data in annotations
1212

13-
You can attach any custom key–value data to annotations using the customData property. This works at two levels:
14-
- Default level with annotationSettings: Applies to all annotations created via the UI.
15-
- Per-annotation-type level: Supply customData in each annotation type settings (highlightSettings, rectangleSettings, etc.).
13+
Annotations can include custom key–value data via the `customData` property. This is supported at two levels:
1614

17-
The customData value can be any serializable object. It is preserved when exporting or importing annotations and is available at runtime on the annotation object.
15+
- Default level via `annotationSettings`: applies to all annotations created through the UI.
16+
- Per-annotation-type level: provide `customData` inside specific annotation-type settings (for example, `highlightSettings`, `rectangleSettings`).
17+
18+
The `customData` value can be any JSON-serializable object. It is preserved during annotation export/import and is available at runtime on the annotation object.
1819

1920
## Default custom data (annotationSettings)
2021

@@ -121,9 +122,9 @@ document.getElementById('CustomData')?.addEventListener('click', () => {
121122
});
122123
```
123124

124-
### Notes
125-
- customData can be any JSON-serializable object and is stored with the annotation.
126-
- Use default annotationSettings.customData for global defaults and override with per-tool settings as needed.
125+
### Note
126+
- `customData` can be any JSON-serializable object and is stored with the annotation.
127+
- Use `annotationSettings.customData` for global defaults and override with per-tool settings as needed.
127128

128129
[View Sample on GitHub](https://github.com/SyncfusionExamples/typescript-pdf-viewer-examples/tree/master)
129130

Document-Processing/PDF/PDF-Viewer/javascript-es6/annotations/custom-tools.md

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

1111
# Custom annotation tools in TypeScript PDF Viewer
1212

13-
PDF viewer allows to add your own toolbar and toggle PDF annotation tools programmatically using the setAnnotationMode method. You can enable tools such as Highlight, Underline, Rectangle, Circle, Arrow, Free Text, Ink, and Measurement annotations (Distance, Perimeter, Area, Radius).
13+
The PDF Viewer supports adding a custom toolbar and toggling annotation tools programmatically using the `setAnnotationMode` method. The viewer can enable tools such as Highlight, Underline, Rectangle, Circle, Arrow, Free Text, Ink, and measurement annotations (Distance, Perimeter, Area, Radius)
1414

1515
Follow these steps to build a minimal custom annotation toolbar.
1616

1717
Step 1: Start from a basic PDF Viewer sample
1818

19-
See the [Getting started guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es6/getting-started) to create a basic sample.
19+
Refer to the [Getting started guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es6/getting-started) to create a basic sample.
2020

2121
Step 2: Add HTML for a lightweight custom toolbar
2222

23-
Add buttons for the tools you want to expose. You can use plain buttons or Syncfusion Toolbar. Below is a plain-HTML variant that keeps things simple.
23+
Add buttons for the tools to expose. The sample below uses plain HTML buttons for simplicity; replace with a Syncfusion Toolbar for a richer UI if desired.
2424

2525
```html
2626
<div id="annotationToolbar" class="e-pv-custom-anno-toolbar">
@@ -46,7 +46,7 @@ Add buttons for the tools you want to expose. You can use plain buttons or Syncf
4646

4747
Step 3: Import and inject modules
4848

49-
Make sure the Annotation module is injected. If you also want text selection/search, include those as needed.
49+
Ensure the `Annotation` module is injected. Include text selection and search modules if those capabilities are required.
5050

5151
```ts
5252
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch } from '@syncfusion/ej2-pdfviewer';
@@ -87,9 +87,9 @@ const bindAnnoTools = () => {
8787
bindAnnoTools();
8888
```
8989

90-
## Custom Tools Using Syncfusion Toolbar for a richer UI
90+
## Custom tools using Syncfusion Toolbar for a richer UI
9191

92-
You can replace the plain buttons with Syncfusion EJ2 Toolbar items and icons similar to the custom toolbar sample. Here is a compact example showing a few common tools. Add the Toolbar package (@syncfusion/ej2-navigations) and wire each item’s click to setAnnotationMode.
92+
Replace the plain buttons with Syncfusion EJ2 Toolbar items and icons for a richer UI. The compact example below shows common tools. Add the Toolbar package `@syncfusion/ej2-navigations` and wire each item’s click handler to `setAnnotationMode`.
9393

9494
```ts
9595
import { Toolbar as Tool, ClickEventArgs, ItemModel } from '@syncfusion/ej2-navigations';
@@ -147,11 +147,10 @@ const annoToolbar = new Tool({
147147
annoToolbar.appendTo('#annotationToolbar');
148148
```
149149

150-
Notes
150+
Note
151151

152-
- setAnnotationMode accepts the annotation type name. Common values include: Highlight, Underline, Strikethrough, StickyNotes, FreeText, Ink, Rectangle, Circle, Line, Arrow, Polygon, Polyline, Distance, Perimeter, Area, Radius, and None to exit.
153-
- You can predefine default annotation styles using the corresponding settings properties (for example, areaSettings as shown in the Area annotation topic).
154-
- To combine with a fully custom viewer toolbar, see Custom Toolbar in TypeScript PDF Viewer.
152+
- `setAnnotationMode` accepts the annotation type name. Common values include: `Highlight`, `Underline`, `Strikethrough`, `StickyNotes`, `FreeText`, `Ink`, `Rectangle`, `Circle`, `Line`, `Arrow`, `Polygon`, `Polyline`, `Distance`, `Perimeter`, `Area`, `Radius`, and `None` to exit.
153+
- Default annotation styles can be predefined using the corresponding settings properties (for example, `areaSettings`).
155154

156155
[View Sample on GitHub](https://github.com/SyncfusionExamples/typescript-pdf-viewer-examples/tree/master)
157156

Document-Processing/PDF/PDF-Viewer/javascript-es6/annotations/customize-annotation.md

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

1111
# Customize annotations
1212

13-
You can customize annotation color, stroke color, thickness, opacity, and other properties using the built‑in UI or via code. This page summarizes common customization patterns and shows how to set defaults per annotation type.
13+
Annotation appearance and behavior (for example color, stroke color, thickness, and opacity) can be customized using the built‑in UI or programmatically. This page summarizes common customization patterns and shows how to set defaults per annotation type.
1414

1515
## Customize via UI
1616

1717
Use the annotation toolbar after selecting an annotation:
18-
- Edit Color: changes the annotation fill/text color
18+
- Edit color: changes the annotation fill/text color
1919
![Edit color](../images/edit_color.png)
20-
- Edit Stroke Color: changes border/line color (shapes and lines)
20+
- Edit stroke color: changes border or line color for shapes and lines types.
2121
![Edit stroke color](../images/shape_strokecolor.png)
22-
- Edit Thickness: adjusts border/line thickness
22+
- Edit thickness: adjusts border or line thickness
2323
![Edit thickness](../images/shape_thickness.png)
24-
- Edit Opacity: adjusts transparency
24+
- Edit opacity: adjusts transparency
2525
![Edit opacity](../images/shape_opacity.png)
2626

27-
Type‑specific options (for example, Line Properties) are available from the context menu (right‑click > Properties) where supported.
27+
Type‑specific options (for example, Line properties) are available from the context menu (right‑click > Properties) where supported.
2828

2929
## Set default properties during initialization
3030

31-
You can set defaults for specific annotation types when creating the PdfViewer instance. You can set author, subject, color, opacity using Annotation Settings. Below are examples using settings already used in the annotation type pages.
31+
Set defaults for specific annotation types when creating the `PdfViewer` instance. Configure properties such as author, subject, color, and opacity using annotation settings. The examples below reference settings used on the annotation type pages.
3232

33-
TextMarkup Annotations:
33+
Text markup annotations:
3434

35-
- Highlight : Set default properties before creating the control using [`highlightSettings`](./annotation-types/highlight-annotation/#set-default-properties-during-control-initialization)
35+
- Highlight: Set default properties before creating the control using [`highlightSettings`](./annotation-types/highlight-annotation/#set-default-properties-during-control-initialization)
3636
- Strikethrough: Use [`strikethroughSettings`](./annotation-types/strikethrough-annotation/#default-strikethrough-settings-during-initialization)
3737
- Underline: Use [`underlineSettings`](./annotation-types/underline-annotation/#default-underline-settings-during-initialization)
3838
- Squiggly: Use [`squigglySettings`](./annotation-types/Squiggly-annotation/#set-default-properties-during-control-initialization)
3939

40-
Shape Annotations:
40+
Shape annotations:
4141

4242
- Line: Use [`lineSettings`](./annotation-types/line-annotation/#default-line-settings-during-initialization)
4343
- Arrow: Use [`arrowSettings`](./annotation-types/arrow-annotation/#default-arrow-settings-during-initialization)
4444
- Rectangle: Use [`rectangleSettings`](./annotation-types/rectangle-annotation/#default-rectangle-settings-during-initialization)
45-
- Circle : Use [`circleSettings`](./annotation-types/circle-annotation/#default-circle-settings-during-initialization)
45+
- Circle: Use [`circleSettings`](./annotation-types/circle-annotation/#default-circle-settings-during-initialization)
4646
- Polygon: Use [`polygonSettings`](./annotation-types/polygon-annotation/#default-polygon-settings-during-initialization)
4747

48-
Measurement Annotations:
48+
Measurement annotations:
4949

5050
- Distance: Use [`distanceSettings`](./annotation-types/distance-annotation/#default-distance-settings-during-initialization)
5151
- Perimeter: Use [`perimeterSettings`](./annotation-types/perimeter-annotation/#default-perimeter-settings-during-initialization)
@@ -56,10 +56,10 @@ Measurement Annotations:
5656
Other Annotations:
5757

5858
- Redaction: Use [`redactionSettings`](./annotation-types/redaction-annotation/#default-redaction-settings-during-initialization)
59-
- Free Text: Use [`freeTextSettings`](./annotation-types/free-text-annotation/#default-free-text-settings-during-initialization)
60-
- Ink (Freehand): Use [`inkAnnotationSettings`](./annotation-types/ink-annotation/#default-ink-settings-during-initialization)
59+
- Free text: Use [`freeTextSettings`](./annotation-types/free-text-annotation/#default-free-text-settings-during-initialization)
60+
- Ink (freehand): Use [`inkAnnotationSettings`](./annotation-types/ink-annotation/#default-ink-settings-during-initialization)
6161
- Stamp: Use [`stampSettings`](./annotation-types/stamp-annotation/#default-stamp-settings-during-initialization)
62-
- Sticky Notes: Use [`stickyNotesSettings`](./annotation-types/sticky-notes-annotation/#default-sticky-notes-settings-during-initialization)
62+
- Sticky notes: Use [`stickyNotesSettings`](./annotation-types/sticky-notes-annotation/#default-sticky-notes-settings-during-initialization)
6363

6464
Set defaults for specific annotation types when creating the PdfViewer instance. Below are examples using settings already used in the annotation type pages.
6565

@@ -137,7 +137,7 @@ pdfviewer.appendTo('#PdfViewer');
137137
{% endhighlight %}
138138
{% endtabs %}
139139

140-
N> After changing defaults using UI tools (Edit Color, Edit Opacity, etc.), the values will reflect the latest selection for subsequent annotations in the same session.
140+
N> After changing defaults using UI tools (for example, Edit color or Edit opacity), the updated values apply to subsequent annotations within the same session.
141141

142142
## Customize programmatically at runtime
143143

Document-Processing/PDF/PDF-Viewer/javascript-es6/annotations/delete-annotation.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ domainurl: ##DomainURL##
1010

1111
# Remove annotations
1212

13-
You can remove annotations using the built-in UI or programmatically. This page shows the common ways to delete annotations in the viewer.
13+
Annotations can be removed using the built-in UI or programmatically. This page shows common methods to delete annotations in the viewer.
1414

1515
## Delete via UI
1616

17-
You can delete a selected annotation in three ways:
18-
- Context menu: Right-click the annotation and choose Delete.
17+
A selected annotation can be deleted in three ways:
18+
19+
- Context menu: right-click the annotation and choose Delete.
1920
![Delete via context menu](../annotations/annotation-images/delete-annot-context-menu.png)
20-
- Secondary toolbar: Select the annotation and click the Delete button on the annotation toolbar.
21+
- Annotation toolbar: select the annotation and click the Delete button on the annotation toolbar.
2122
![Delete via annotation toolbar](../annotations/annotation-images/delete-annot.png)
22-
- Keyboard: Select the annotation and press the `Delete` key.
23+
- Keyboard: select the annotation and press the `Delete` key.
2324

2425
## Delete programmatically
2526

26-
You can delete the currently selected annotation, or delete a specific annotation by its id.
27+
Annotations can be deleted programmatically either by removing the currently selected annotation or by specifying an annotation id.
2728

2829
```html
2930
<div class="toolbar">
@@ -85,7 +86,7 @@ document.getElementById('delbyId')?.addEventListener('click', () => {
8586
});
8687
```
8788

88-
N> Deleting via API requires the annotation to exist in the current document. Ensure an annotation is selected when using deleteAnnotation(), or pass a valid id to deleteAnnotationById().
89+
N> Deleting via the API requires the annotation to exist in the current document. Ensure an annotation is selected when using `deleteAnnotation()`, or pass a valid id to `deleteAnnotationById()`.
8990

9091
[View Sample on GitHub](https://github.com/SyncfusionExamples/typescript-pdf-viewer-examples/tree/master)
9192

0 commit comments

Comments
 (0)