Skip to content

Commit de9b03d

Browse files
984373: Update the CI failure
1 parent 4885727 commit de9b03d

File tree

1 file changed

+82
-18
lines changed
  • Document-Processing/PDF/PDF-Viewer/blazor/annotation

1 file changed

+82
-18
lines changed

Document-Processing/PDF/PDF-Viewer/blazor/annotation/events.md

Lines changed: 82 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
layout: post
33
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.
55
platform: document-processing
66
control: SfPdfViewer
77
documentation: ug
88
---
99

1010
# Annotation Events in Blazor SfPdfViewer Component
1111

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.
1313

1414
|Name|Description|
1515
|---|---|
@@ -34,6 +34,10 @@ Annotation events notify the application when annotations are added, selected, m
3434

3535
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.
3636

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+
3741
The following example illustrates how to handle the AddSignature event.
3842

3943
```cshtml
@@ -48,7 +52,7 @@ The following example illustrates how to handle the AddSignature event.
4852
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
4953
public async Task AddSignature(AddSignatureEventArgs args)
5054
{
51-
Console.WriteLine(args.EditingAction);
55+
Console.WriteLine($"Added Signature ID: {args.AnnotationId}");
5256
}
5357
}
5458
@@ -58,6 +62,10 @@ The following example illustrates how to handle the AddSignature event.
5862

5963
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.
6064

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+
6169
The following example illustrates how to handle the AnnotationAdded event.
6270

6371
```cshtml
@@ -72,7 +80,7 @@ The following example illustrates how to handle the AnnotationAdded event.
7280
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
7381
public async Task AnnotationAdded(AnnotationAddEventArgs args)
7482
{
75-
Console.WriteLine(args.EditingAction);
83+
Console.WriteLine($"Added Annotation ID: {args.AnnotationId}");
7684
}
7785
}
7886
@@ -82,6 +90,10 @@ The following example illustrates how to handle the AnnotationAdded event.
8290

8391
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.
8492

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+
8597
The following example illustrates how to handle the AnnotationMouseover event.
8698

8799
```cshtml
@@ -96,7 +108,7 @@ The following example illustrates how to handle the AnnotationMouseover event.
96108
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
97109
public async Task AnnotationMouseover(AnnotationMouseoverEventArgs args)
98110
{
99-
Console.WriteLine(args.EditingAction);
111+
Console.WriteLine($"Annotation Mouseover X: {args.X} and y: {args.X}");
100112
}
101113
}
102114
@@ -106,6 +118,10 @@ The following example illustrates how to handle the AnnotationMouseover event.
106118

107119
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.
108120

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+
109125
The following example illustrates how to handle the AnnotationMoved event.
110126

111127
```cshtml
@@ -120,7 +136,7 @@ The following example illustrates how to handle the AnnotationMoved event.
120136
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
121137
public async Task AnnotationMoved(AnnotationMoveEventArgs args)
122138
{
123-
Console.WriteLine(args.EditingAction);
139+
Console.WriteLine($"Annotation Current Position: {args.CurrentPosition}");
124140
}
125141
}
126142
@@ -130,6 +146,10 @@ The following example illustrates how to handle the AnnotationMoved event.
130146

131147
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.
132148

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+
133153
The following example illustrates how to handle the AnnotationPropertiesChanged event.
134154

135155
```cshtml
@@ -144,7 +164,7 @@ The following example illustrates how to handle the AnnotationPropertiesChanged
144164
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
145165
public async Task AnnotationPropertiesChanged(AnnotationPropertiesChangeEventArgs args)
146166
{
147-
Console.WriteLine(args.EditingAction);
167+
Console.WriteLine($"Is Annotation Color Changed: {args.IsColorChanged}");
148168
}
149169
}
150170
@@ -154,6 +174,10 @@ The following example illustrates how to handle the AnnotationPropertiesChanged
154174

155175
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.
156176

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+
157181
The following example illustrates how to handle the AnnotationRemoved event.
158182

159183
```cshtml
@@ -168,7 +192,7 @@ The following example illustrates how to handle the AnnotationRemoved event.
168192
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
169193
public async Task AnnotationRemoved(AnnotationRemoveEventArgs args)
170194
{
171-
Console.WriteLine(args.EditingAction);
195+
Console.WriteLine($"Removed Annotation ID: {args.AnnotationId}");
172196
}
173197
}
174198
@@ -178,6 +202,10 @@ The following example illustrates how to handle the AnnotationRemoved event.
178202

179203
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.
180204

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+
181209
The following example illustrates how to handle the AnnotationResized event.
182210

183211
```cshtml
@@ -192,7 +220,7 @@ The following example illustrates how to handle the AnnotationResized event.
192220
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
193221
public async Task AnnotationResized(AnnotationResizeEventArgs args)
194222
{
195-
Console.WriteLine(args.EditingAction);
223+
Console.WriteLine($"Resized Annotation ID: {args.AnnotationId}");
196224
}
197225
}
198226
@@ -202,6 +230,10 @@ The following example illustrates how to handle the AnnotationResized event.
202230

203231
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.
204232

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+
205237
The following example illustrates how to handle the AnnotationSelected event.
206238

207239
```cshtml
@@ -216,7 +248,7 @@ The following example illustrates how to handle the AnnotationSelected event.
216248
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
217249
public async Task AnnotationSelected(AnnotationSelectEventArgs args)
218250
{
219-
Console.WriteLine(args.EditingAction);
251+
Console.WriteLine($"Selected Annotation ID: {args.AnnotationId}");
220252
}
221253
}
222254
@@ -226,6 +258,10 @@ The following example illustrates how to handle the AnnotationSelected event.
226258

227259
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.
228260

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+
229265
The following example illustrates how to handle the AnnotationUnselected event.
230266

231267
```cshtml
@@ -240,7 +276,7 @@ The following example illustrates how to handle the AnnotationUnselected event.
240276
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
241277
public async Task AnnotationUnselected(AnnotationUnselectEventArgs args)
242278
{
243-
Console.WriteLine(args.EditingAction);
279+
Console.WriteLine($"UnSelected Annotation ID: {args.AnnotationId}");
244280
}
245281
}
246282
@@ -250,6 +286,10 @@ The following example illustrates how to handle the AnnotationUnselected event.
250286

251287
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.
252288

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+
253293
The following example illustrates how to handle the MoveSignature event.
254294

255295
```cshtml
@@ -264,7 +304,7 @@ The following example illustrates how to handle the MoveSignature event.
264304
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
265305
public async Task MoveSignature(MoveSignatureEventArgs args)
266306
{
267-
Console.WriteLine(args.EditingAction);
307+
Console.WriteLine($"Moved Signture ID: {args.AnnotationId}");
268308
}
269309
}
270310
@@ -274,6 +314,10 @@ The following example illustrates how to handle the MoveSignature event.
274314

275315
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.
276316

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+
277321
The following example illustrates how to handle the OnAnnotationDoubleClick event.
278322

279323
```cshtml
@@ -288,7 +332,7 @@ The following example illustrates how to handle the OnAnnotationDoubleClick even
288332
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
289333
public async Task OnAnnotationDoubleClick(AnnotationDoubleClickEventArgs args)
290334
{
291-
Console.WriteLine(args.EditingAction);
335+
Console.WriteLine($"Double Clicked Annotation ID: {args.AnnotationId}");
292336
}
293337
}
294338
@@ -298,6 +342,10 @@ The following example illustrates how to handle the OnAnnotationDoubleClick even
298342

299343
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.
300344

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+
301349
The following example illustrates how to handle the RemoveSignature event.
302350

303351
```cshtml
@@ -312,7 +360,7 @@ The following example illustrates how to handle the RemoveSignature event.
312360
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
313361
public async Task RemoveSignature(RemoveSignatureEventArgs args)
314362
{
315-
Console.WriteLine(args.EditingAction);
363+
Console.WriteLine($"Removed Signature ID: {args.AnnotationId}");
316364
}
317365
}
318366
@@ -322,6 +370,10 @@ The following example illustrates how to handle the RemoveSignature event.
322370

323371
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.
324372

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+
325377
The following example illustrates how to handle the ResizeSignature event.
326378

327379
```cshtml
@@ -336,7 +388,7 @@ The following example illustrates how to handle the ResizeSignature event.
336388
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
337389
public async Task ResizeSignature(ResizeSignatureEventArgs args)
338390
{
339-
Console.WriteLine(args.EditingAction);
391+
Console.WriteLine($"Resized Signature ID: {args.AnnotationId}");
340392
}
341393
}
342394
@@ -346,6 +398,10 @@ The following example illustrates how to handle the ResizeSignature event.
346398

347399
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.
348400

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+
349405
The following example illustrates how to handle the SignaturePropertiesChange event.
350406

351407
```cshtml
@@ -360,7 +416,7 @@ The following example illustrates how to handle the SignaturePropertiesChange ev
360416
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
361417
public async Task SignaturePropertiesChange(SignaturePropertiesChangeEventArgs args)
362418
{
363-
Console.WriteLine(args.EditingAction);
419+
Console.WriteLine($"Is Stroke Color Changed: {args.IsStrokeColorChanged}");
364420
}
365421
}
366422
@@ -370,6 +426,10 @@ The following example illustrates how to handle the SignaturePropertiesChange ev
370426

371427
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.
372428

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+
373433
The following example illustrates how to handle the SignatureSelected event.
374434

375435
```cshtml
@@ -384,7 +444,7 @@ The following example illustrates how to handle the SignatureSelected event.
384444
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
385445
public async Task SignatureSelected(SignatureSelectEventArgs args)
386446
{
387-
Console.WriteLine(args.EditingAction);
447+
Console.WriteLine($"Selected Signture ID: {args.AnnotationId}");
388448
}
389449
}
390450
@@ -394,6 +454,10 @@ The following example illustrates how to handle the SignatureSelected event.
394454

395455
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.
396456

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+
397461
The following example illustrates how to handle the SignatureUnselected event.
398462

399463
```cshtml
@@ -408,7 +472,7 @@ The following example illustrates how to handle the SignatureUnselected event.
408472
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
409473
public async Task SignatureUnselected(SignatureSelectEventArgs args)
410474
{
411-
Console.WriteLine(args.EditingAction);
475+
Console.WriteLine($"UnSelected Signature ID: {args.AnnotationId}");
412476
}
413477
}
414478

0 commit comments

Comments
 (0)