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/blazor/annotation/events.md
+82-18Lines changed: 82 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
---
2
2
layout: post
3
3
title: Annotation Events in Blazor SfPdfViewer Component | Syncfusion
4
-
description: Learn how to subscribe to and handle annotation events in the Syncfusion Blazor SfPdfViewer.
4
+
description: Learn how to subscribe to and handle annotations and signature annotation events in the Syncfusion Blazor SfPdfViewer.
5
5
platform: document-processing
6
6
control: SfPdfViewer
7
7
documentation: ug
8
8
---
9
9
10
10
# Annotation Events in Blazor SfPdfViewer Component
11
11
12
-
Annotation events notify the application when annotations are added, selected, moved, resized, modified, or removed. The following events can be subscribed through the PdfViewerEvents tag in the SfPdfViewer component.
12
+
Annotation events notify the application when annotations are added, selected, moved, resized, modified, or removed. Subscribe to these events by using the PdfViewerEvents tag inside the SfPdfViewer component.
13
13
14
14
|Name|Description|
15
15
|---|---|
@@ -34,6 +34,10 @@ Annotation events notify the application when annotations are added, selected, m
34
34
35
35
The [AddSignature](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_AddSignature) event triggers when a signature is added to a page in the PDF document.
36
36
37
+
#### Event Arguments
38
+
39
+
For event data, see [AddSignatureEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.AddSignatureEventArgs.html) for properties such as AnnotationId, PageNumber, and Bounds.
40
+
37
41
The following example illustrates how to handle the AddSignature event.
38
42
39
43
```cshtml
@@ -48,7 +52,7 @@ The following example illustrates how to handle the AddSignature event.
@@ -58,6 +62,10 @@ The following example illustrates how to handle the AddSignature event.
58
62
59
63
The [AnnotationAdded](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_AnnotationAdded) event triggers when an annotation is added to a page in the PDF document.
60
64
65
+
#### Event Arguments
66
+
67
+
See [AnnotationAddedEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.AnnotationAddedEventArgs.html) for details such as AnnotationId, AnnotationType, PageNumber, and Bounds.
68
+
61
69
The following example illustrates how to handle the AnnotationAdded event.
62
70
63
71
```cshtml
@@ -72,7 +80,7 @@ The following example illustrates how to handle the AnnotationAdded event.
@@ -82,6 +90,10 @@ The following example illustrates how to handle the AnnotationAdded event.
82
90
83
91
The [AnnotationMouseover](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_AnnotationMouseover) event triggers when the mouse pointer moves over an annotation object.
84
92
93
+
#### Event Arguments
94
+
95
+
See [AnnotationMouseoverEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.AnnotationMouseoverEventArgs.html) for details such as AnnotationId, AnnotationType, PageNumber, and cursor position.
96
+
85
97
The following example illustrates how to handle the AnnotationMouseover event.
86
98
87
99
```cshtml
@@ -96,7 +108,7 @@ The following example illustrates how to handle the AnnotationMouseover event.
public async Task AnnotationMouseover(AnnotationMouseoverEventArgs args)
98
110
{
99
-
Console.WriteLine(args.EditingAction);
111
+
Console.WriteLine($"Annotation Mouseover X: {args.X} and y: {args.X}");
100
112
}
101
113
}
102
114
@@ -106,6 +118,10 @@ The following example illustrates how to handle the AnnotationMouseover event.
106
118
107
119
The [AnnotationMoved](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_AnnotationMoved) event triggers when an annotation is moved on a page in the PDF document.
108
120
121
+
#### Event Arguments
122
+
123
+
See [AnnotationMovedEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.AnnotationMovedEventArgs.html) for details such as AnnotationId, PageNumber, PreviousBounds, and Bounds.
124
+
109
125
The following example illustrates how to handle the AnnotationMoved event.
110
126
111
127
```cshtml
@@ -120,7 +136,7 @@ The following example illustrates how to handle the AnnotationMoved event.
public async Task AnnotationMoved(AnnotationMoveEventArgs args)
122
138
{
123
-
Console.WriteLine(args.EditingAction);
139
+
Console.WriteLine($"Annotation Current Position: {args.CurrentPosition}");
124
140
}
125
141
}
126
142
@@ -130,6 +146,10 @@ The following example illustrates how to handle the AnnotationMoved event.
130
146
131
147
The [AnnotationPropertiesChanged](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_AnnotationPropertiesChanged) event triggers when annotation properties are modified on a PDF page.
132
148
149
+
#### Event Arguments
150
+
151
+
See [AnnotationPropertiesChangedEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.AnnotationPropertiesChangedEventArgs.html) for details such as AnnotationId, PageNumber, changed property names, and old/new values.
152
+
133
153
The following example illustrates how to handle the AnnotationPropertiesChanged event.
134
154
135
155
```cshtml
@@ -144,7 +164,7 @@ The following example illustrates how to handle the AnnotationPropertiesChanged
public async Task AnnotationPropertiesChanged(AnnotationPropertiesChangeEventArgs args)
146
166
{
147
-
Console.WriteLine(args.EditingAction);
167
+
Console.WriteLine($"Is Annotation Color Changed: {args.IsColorChanged}");
148
168
}
149
169
}
150
170
@@ -154,6 +174,10 @@ The following example illustrates how to handle the AnnotationPropertiesChanged
154
174
155
175
The [AnnotationRemoved](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_AnnotationRemoved) event triggers when an annotation is removed from a page in the PDF document.
156
176
177
+
#### Event Arguments
178
+
179
+
See [AnnotationRemovedEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.AnnotationRemovedEventArgs.html) for details such as AnnotationId, AnnotationType, and PageNumber.
180
+
157
181
The following example illustrates how to handle the AnnotationRemoved event.
158
182
159
183
```cshtml
@@ -168,7 +192,7 @@ The following example illustrates how to handle the AnnotationRemoved event.
@@ -178,6 +202,10 @@ The following example illustrates how to handle the AnnotationRemoved event.
178
202
179
203
The [AnnotationResized](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_AnnotationResized) event triggers when an annotation is resized on a page in the PDF document.
180
204
205
+
#### Event Arguments
206
+
207
+
See [AnnotationResizedEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.AnnotationResizedEventArgs.html) for details such as AnnotationId, PageNumber, PreviousBounds, and Bounds.
208
+
181
209
The following example illustrates how to handle the AnnotationResized event.
182
210
183
211
```cshtml
@@ -192,7 +220,7 @@ The following example illustrates how to handle the AnnotationResized event.
@@ -202,6 +230,10 @@ The following example illustrates how to handle the AnnotationResized event.
202
230
203
231
The [AnnotationSelected](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_AnnotationSelected) event triggers when an annotation is selected on a page in the PDF document.
204
232
233
+
#### Event Arguments
234
+
235
+
See [AnnotationSelectedEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.AnnotationSelectedEventArgs.html) for details such as AnnotationId, AnnotationType, and PageNumber.
236
+
205
237
The following example illustrates how to handle the AnnotationSelected event.
206
238
207
239
```cshtml
@@ -216,7 +248,7 @@ The following example illustrates how to handle the AnnotationSelected event.
@@ -226,6 +258,10 @@ The following example illustrates how to handle the AnnotationSelected event.
226
258
227
259
The [AnnotationUnselected](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_AnnotationUnselected) event triggers when an annotation is unselected on a page in the PDF document.
228
260
261
+
#### Event Arguments
262
+
263
+
See [AnnotationUnselectedEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.AnnotationUnselectedEventArgs.html) for details such as AnnotationId, AnnotationType, and PageNumber.
264
+
229
265
The following example illustrates how to handle the AnnotationUnselected event.
230
266
231
267
```cshtml
@@ -240,7 +276,7 @@ The following example illustrates how to handle the AnnotationUnselected event.
@@ -250,6 +286,10 @@ The following example illustrates how to handle the AnnotationUnselected event.
250
286
251
287
The [MoveSignature](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_MoveSignature) event triggers when a signature is moved on a page in the PDF document.
252
288
289
+
#### Event Arguments
290
+
291
+
See [MoveSignatureEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.MoveSignatureEventArgs.html) for details such as AnnotationId, PageNumber, PreviousBounds, and Bounds.
292
+
253
293
The following example illustrates how to handle the MoveSignature event.
254
294
255
295
```cshtml
@@ -264,7 +304,7 @@ The following example illustrates how to handle the MoveSignature event.
@@ -274,6 +314,10 @@ The following example illustrates how to handle the MoveSignature event.
274
314
275
315
The [OnAnnotationDoubleClick](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_OnAnnotationDoubleClick) event triggers when an annotation is double-clicked.
276
316
317
+
#### Event Arguments
318
+
319
+
See [AnnotationDoubleClickEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.AnnotationDoubleClickEventArgs.html) for details such as AnnotationId, AnnotationType, PageNumber, and mouse position.
320
+
277
321
The following example illustrates how to handle the OnAnnotationDoubleClick event.
278
322
279
323
```cshtml
@@ -288,7 +332,7 @@ The following example illustrates how to handle the OnAnnotationDoubleClick even
@@ -298,6 +342,10 @@ The following example illustrates how to handle the OnAnnotationDoubleClick even
298
342
299
343
The [RemoveSignature](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_RemoveSignature) event triggers when a signature is removed from a page in the PDF document.
300
344
345
+
#### Event Arguments
346
+
347
+
See [RemoveSignatureEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.RemoveSignatureEventArgs.html) for details such as AnnotationId and PageNumber.
348
+
301
349
The following example illustrates how to handle the RemoveSignature event.
302
350
303
351
```cshtml
@@ -312,7 +360,7 @@ The following example illustrates how to handle the RemoveSignature event.
@@ -322,6 +370,10 @@ The following example illustrates how to handle the RemoveSignature event.
322
370
323
371
The [ResizeSignature](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_ResizeSignature) event triggers when a signature is resized on a page in the PDF document.
324
372
373
+
#### Event Arguments
374
+
375
+
See [ResizeSignatureEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.ResizeSignatureEventArgs.html) for details such as AnnotationId, PageNumber, PreviousBounds, and Bounds.
376
+
325
377
The following example illustrates how to handle the ResizeSignature event.
326
378
327
379
```cshtml
@@ -336,7 +388,7 @@ The following example illustrates how to handle the ResizeSignature event.
@@ -346,6 +398,10 @@ The following example illustrates how to handle the ResizeSignature event.
346
398
347
399
The [SignaturePropertiesChange](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_SignaturePropertiesChange) event triggers when the properties of a signature are changed on a page in the PDF document.
348
400
401
+
#### Event Arguments
402
+
403
+
See [SignaturePropertiesChangeEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.SignaturePropertiesChangeEventArgs.html) for details such as AnnotationId, PageNumber, and changed property values.
404
+
349
405
The following example illustrates how to handle the SignaturePropertiesChange event.
350
406
351
407
```cshtml
@@ -360,7 +416,7 @@ The following example illustrates how to handle the SignaturePropertiesChange ev
public async Task SignaturePropertiesChange(SignaturePropertiesChangeEventArgs args)
362
418
{
363
-
Console.WriteLine(args.EditingAction);
419
+
Console.WriteLine($"Is Stroke Color Changed: {args.IsStrokeColorChanged}");
364
420
}
365
421
}
366
422
@@ -370,6 +426,10 @@ The following example illustrates how to handle the SignaturePropertiesChange ev
370
426
371
427
The [SignatureSelected](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_SignatureSelected) event triggers when a signature is selected on a page in the PDF document.
372
428
429
+
#### Event Arguments
430
+
431
+
See [SignatureSelectedEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.SignatureSelectedEventArgs.html) for details such as AnnotationId and PageNumber.
432
+
373
433
The following example illustrates how to handle the SignatureSelected event.
374
434
375
435
```cshtml
@@ -384,7 +444,7 @@ The following example illustrates how to handle the SignatureSelected event.
@@ -394,6 +454,10 @@ The following example illustrates how to handle the SignatureSelected event.
394
454
395
455
The [SignatureUnselected](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_SignatureUnselected) event triggers when a signature is unselected on a page in the PDF document.
396
456
457
+
#### Event Arguments
458
+
459
+
See [SignatureUnselectedEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.SignatureUnselectedEventArgs.html) for details such as AnnotationId and PageNumber.
460
+
397
461
The following example illustrates how to handle the SignatureUnselected event.
398
462
399
463
```cshtml
@@ -408,7 +472,7 @@ The following example illustrates how to handle the SignatureUnselected event.
0 commit comments