You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/javascript-es6/annotations/create-modify-annotation.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,36 +10,36 @@ domainurl: ##DomainURL##
10
10
11
11
# Create and modify annotations
12
12
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.
14
14
15
15
## Quick navigation to annotation types
16
16
17
17
Jump directly to a specific annotation type for detailed usage and examples:
- 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
65
65
66
66
### Create programmatically
67
67
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`.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/javascript-es6/annotations/custom-data.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,12 @@ domainurl: ##DomainURL##
10
10
11
11
# Custom data in annotations
12
12
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:
16
14
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.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/javascript-es6/annotations/custom-tools.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,17 +10,17 @@ domainurl: ##DomainURL##
10
10
11
11
# Custom annotation tools in TypeScript PDF Viewer
12
12
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)
14
14
15
15
Follow these steps to build a minimal custom annotation toolbar.
16
16
17
17
Step 1: Start from a basic PDF Viewer sample
18
18
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.
20
20
21
21
Step 2: Add HTML for a lightweight custom toolbar
22
22
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.
## Custom Tools Using Syncfusion Toolbar for a richer UI
90
+
## Custom tools using Syncfusion Toolbar for a richer UI
91
91
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`.
@@ -147,11 +147,10 @@ const annoToolbar = new Tool({
147
147
annoToolbar.appendTo('#annotationToolbar');
148
148
```
149
149
150
-
Notes
150
+
Note
151
151
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`).
155
154
156
155
[View Sample on GitHub](https://github.com/SyncfusionExamples/typescript-pdf-viewer-examples/tree/master)
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/javascript-es6/annotations/customize-annotation.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,42 +10,42 @@ domainurl: ##DomainURL##
10
10
11
11
# Customize annotations
12
12
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.
14
14
15
15
## Customize via UI
16
16
17
17
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
19
19

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.
- Edit thickness: adjusts border or line thickness
23
23

24
-
- Edit Opacity: adjusts transparency
24
+
- Edit opacity: adjusts transparency
25
25

26
26
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.
28
28
29
29
## Set default properties during initialization
30
30
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.
32
32
33
-
TextMarkup Annotations:
33
+
Text markup annotations:
34
34
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)
36
36
- Strikethrough: Use [`strikethroughSettings`](./annotation-types/strikethrough-annotation/#default-strikethrough-settings-during-initialization)
37
37
- Underline: Use [`underlineSettings`](./annotation-types/underline-annotation/#default-underline-settings-during-initialization)
38
38
- Squiggly: Use [`squigglySettings`](./annotation-types/Squiggly-annotation/#set-default-properties-during-control-initialization)
39
39
40
-
Shape Annotations:
40
+
Shape annotations:
41
41
42
42
- Line: Use [`lineSettings`](./annotation-types/line-annotation/#default-line-settings-during-initialization)
43
43
- Arrow: Use [`arrowSettings`](./annotation-types/arrow-annotation/#default-arrow-settings-during-initialization)
44
44
- 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)
46
46
- Polygon: Use [`polygonSettings`](./annotation-types/polygon-annotation/#default-polygon-settings-during-initialization)
47
47
48
-
Measurement Annotations:
48
+
Measurement annotations:
49
49
50
50
- Distance: Use [`distanceSettings`](./annotation-types/distance-annotation/#default-distance-settings-during-initialization)
51
51
- Perimeter: Use [`perimeterSettings`](./annotation-types/perimeter-annotation/#default-perimeter-settings-during-initialization)
@@ -56,10 +56,10 @@ Measurement Annotations:
56
56
Other Annotations:
57
57
58
58
- 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)
61
61
- 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)
63
63
64
64
Set defaults for specific annotation types when creating the PdfViewer instance. Below are examples using settings already used in the annotation type pages.
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.
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()`.
89
90
90
91
[View Sample on GitHub](https://github.com/SyncfusionExamples/typescript-pdf-viewer-examples/tree/master)
0 commit comments