Skip to content

Commit c3e7d9e

Browse files
984373: Update the events
1 parent 8e45f27 commit c3e7d9e

File tree

2 files changed

+214
-8
lines changed

2 files changed

+214
-8
lines changed

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

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ Annotation events notify the application when annotations are added, selected, m
2222
|AnnotationResized|Triggers when an annotation is resized on a page in the PDF document.|
2323
|AnnotationSelected|Triggers when an annotation is selected on a page in the PDF document.|
2424
|AnnotationUnselected|Triggers when an annotation is unselected on a page in the PDF document.|
25+
|ExportFailed|Triggers when exporting annotations fails in the SfPdfViewer.|
26+
|ExportStarted|Triggers when exporting annotations starts in the SfPdfViewer.|
27+
|ExportSucceed|Triggers when exporting annotations succeeds in the SfPdfViewer.|
28+
|ImportFailed|Triggers when importing annotations fails in the PDF document.|
29+
|ImportStarted|Triggers when importing annotations starts in the PDF document.|
30+
|ImportSucceed|Triggers when importing annotations succeeds in the PDF document.|
2531
|MoveSignature|Triggers when a signature is moved on a page in the PDF document.|
2632
|OnAnnotationDoubleClick|Triggers when an annotation is double-clicked.|
2733
|RemoveSignature|Triggers when a signature is removed from a page in the PDF document.|
@@ -282,6 +288,174 @@ The following example illustrates how to handle the AnnotationUnselected event.
282288
283289
```
284290

291+
## ExportFailed Event
292+
293+
The [ExportFailed](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_ExportFailed) event triggers when an export annotations failed in the PDF Viewer.
294+
295+
#### Event Arguments
296+
297+
See [ExportFailureEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.ExportFailureEventArgs.html) for details such as ErrorDetails.
298+
299+
The following example illustrates how to handle the ExportFailed event.
300+
301+
```cshtml
302+
303+
@using Syncfusion.Blazor.SfPdfViewer
304+
305+
<SfPdfViewer2 DocumentPath="@DocumentPath" Height="100%" Width="100%">
306+
<PdfViewerEvents ExportFailed="@ExportFailed"></PdfViewerEvents>
307+
</SfPdfViewer2>
308+
309+
@code{
310+
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
311+
public async Task ExportFailed(ExportFailureEventArgs args)
312+
{
313+
Console.WriteLine($"Error details: {args.ErrorDetails}");
314+
}
315+
}
316+
317+
```
318+
319+
## ExportStarted Event
320+
321+
The [ExportStarted](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_ExportStarted) event triggers when an exported annotations started in the PDF Viewer.
322+
323+
#### Event Arguments
324+
325+
See [ExportStartEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.ExportStartEventArgs.html) triggers when an exported annotations started in the PDF Viewer.
326+
327+
The following example illustrates how to handle the ExportStarted event.
328+
329+
```cshtml
330+
331+
@using Syncfusion.Blazor.SfPdfViewer
332+
333+
<SfPdfViewer2 DocumentPath="@DocumentPath" Height="100%" Width="100%">
334+
<PdfViewerEvents ExportStarted="@ExportStarted"></PdfViewerEvents>
335+
</SfPdfViewer2>
336+
337+
@code{
338+
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
339+
public async Task ExportStarted(ExportStartEventArgs args)
340+
{
341+
Console.WriteLine("Export Action Started");
342+
}
343+
}
344+
345+
```
346+
347+
## ExportSucceed Event
348+
349+
The [ExportSucceed](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_ExportSucceed) event triggers when an export annotations succeed in the PDF Viewer.
350+
351+
#### Event Arguments
352+
353+
See [ExportSuccessEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.ExportSuccessEventArgs.html) for details such as FileName.
354+
355+
The following example illustrates how to handle the ExportSucceed event.
356+
357+
```cshtml
358+
359+
@using Syncfusion.Blazor.SfPdfViewer
360+
361+
<SfPdfViewer2 DocumentPath="@DocumentPath" Height="100%" Width="100%">
362+
<PdfViewerEvents ExportSucceed="@ExportSucceed"></PdfViewerEvents>
363+
</SfPdfViewer2>
364+
365+
@code{
366+
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
367+
public async Task ExportSucceed(ExportSuccessEventArgs args)
368+
{
369+
Console.WriteLine($"Exported File name : {args.FileName }");
370+
}
371+
}
372+
373+
```
374+
375+
## ImportFailed Event
376+
377+
The [ImportFailed](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_ImportFailed) event triggers when an imports annotations failed in the PDF document.
378+
379+
#### Event Arguments
380+
381+
See [ImportFailureEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.ImportFailureEventArgs.html) for details such as ErrorDetails.
382+
383+
The following example illustrates how to handle the ImportFailed event.
384+
385+
```cshtml
386+
387+
@using Syncfusion.Blazor.SfPdfViewer
388+
389+
<SfPdfViewer2 DocumentPath="@DocumentPath" Height="100%" Width="100%">
390+
<PdfViewerEvents ImportFailed="@ImportFailed"></PdfViewerEvents>
391+
</SfPdfViewer2>
392+
393+
@code{
394+
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
395+
public async Task ImportFailed(ImportFailureEventArgs args)
396+
{
397+
Console.WriteLine($"Error details: {args.ErrorDetails}");
398+
}
399+
}
400+
401+
```
402+
403+
## ImportStarted Event
404+
405+
The [ImportStarted](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_ImportStarted) event triggers when an imported annotations started in the PDF document.
406+
407+
#### Event Arguments
408+
409+
See [ImportStartEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.ImportStartEventArgs.html) triggers when an imported annotations started in the PDF document.
410+
411+
The following example illustrates how to handle the ImportStarted event.
412+
413+
```cshtml
414+
415+
@using Syncfusion.Blazor.SfPdfViewer
416+
417+
<SfPdfViewer2 DocumentPath="@DocumentPath" Height="100%" Width="100%">
418+
<PdfViewerEvents ImportStarted="@ImportStarted"></PdfViewerEvents>
419+
</SfPdfViewer2>
420+
421+
@code{
422+
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
423+
public async Task ImportStarted(ImportStartEventArgs args)
424+
{
425+
Console.WriteLine("Import Annotation Started");
426+
}
427+
}
428+
429+
```
430+
431+
## ImportSucceed Event
432+
433+
The [ImportSucceed](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerEvents.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerEvents_ImportSucceed) event triggers when an imports annotations succeed in the PDF document.
434+
435+
#### Event Arguments
436+
437+
See [ImportSuccessEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.ImportSuccessEventArgs.html) triggers when an imports annotations succeed in the PDF document.
438+
439+
The following example illustrates how to handle the ImportSucceed event.
440+
441+
```cshtml
442+
443+
@using Syncfusion.Blazor.SfPdfViewer
444+
445+
<SfPdfViewer2 DocumentPath="@DocumentPath" Height="100%" Width="100%">
446+
<PdfViewerEvents ImportSucceed="@ImportSucceed"></PdfViewerEvents>
447+
</SfPdfViewer2>
448+
449+
@code{
450+
private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succintly.pdf";
451+
public async Task ImportSucceed(ImportSuccessEventArgs args)
452+
{
453+
Console.WriteLine("Annotation Imported Successfully");
454+
}
455+
}
456+
457+
```
458+
285459
## MoveSignature Event
286460

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

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

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: post
33
title: Events in Blazor SfPdfViewer Component | Syncfusion
4-
description: Explore all events available in the Syncfusion Blazor SfPdfViewer component, including lifecycle, navigation, search, and printing events.
4+
description: Explore all events available in the Syncfusion Blazor SfPdfViewer component, including lifecycle, navigation, annotation, search, and printing events.
55
platform: document-processing
66
control: SfPdfViewer
77
documentation: ug
@@ -13,7 +13,15 @@ The following events are available in the SfPdfViewer component.
1313

1414
|Name|Description|
1515
|---|---|
16-
|AjaxRequestFailed|Triggers when an AJAX request fails.|
16+
|AddSignature|Triggers when a signature is added to a page in the PDF document.|
17+
|AnnotationAdded|Triggers when an annotation is added to a page in the PDF document.|
18+
|AnnotationMouseover|Triggers when the mouse pointer moves over an annotation object.|
19+
|AnnotationMoved|Triggers when an annotation is moved on a page in the PDF document.|
20+
|AnnotationPropertiesChanged|Triggers when annotation properties are modified on a PDF page.|
21+
|AnnotationRemoved|Triggers when an annotation is removed from a page in the PDF document.|
22+
|AnnotationResized|Triggers when an annotation is resized on a page in the PDF document.|
23+
|AnnotationSelected|Triggers when an annotation is selected on a page in the PDF document.|
24+
|AnnotationUnselected|Triggers when an annotation is unselected on a page in the PDF document.|
1725
|Created|Triggers when the PDF Viewer component is created.|
1826
|DocumentEdited|Triggers when the PDF document is edited in the SfPdfViewer.|
1927
|DocumentLoaded|Triggers when a document is loaded into the PDF Viewer.|
@@ -25,9 +33,31 @@ The following events are available in the SfPdfViewer component.
2533
|ExportStarted|Triggers when exporting annotations starts in the SfPdfViewer.|
2634
|ExportSucceed|Triggers when exporting annotations succeeds in the SfPdfViewer.|
2735
|ExtractTextCompleted|Triggers when text extraction is completed in the SfPdfViewer.|
36+
|FormFieldAdded|Triggered when a form field is added to the PDF document.|
37+
|FormFieldAdding|Triggered before a new form field is added, allowing validation before insertion.|
38+
|FormFieldClick|Triggered when a user clicks on a form field while designer mode is off.|
39+
|FormFieldDeleted|Triggered when a form field is removed from the document.|
40+
|FormFieldDoubleClick|Triggered when a form field is double-clicked.|
41+
|FormFieldFocusIn|Triggered when focus enters a form field.|
42+
|FormFieldFocusOut|Triggered when focus leaves a form field.|
43+
|FormFieldMouseEnter|Triggered when the mouse hovers over a form field.|
44+
|FormFieldMouseLeave|Triggered when the mouse leaves a form field.|
45+
|FormFieldPropertyChanged|Triggered when a form field's properties are modified.|
46+
|FormFieldResized|Triggered when a form field is resized.|
47+
|FormFieldSelected|Triggered when a form field is selected.|
48+
|FormFieldsExported|Triggered when form fields are successfully exported.|
49+
|FormFieldsExportFailed |Triggered when form fields export operation fails.|
50+
|FormFieldsExporting|Triggered before form fields are exported, allowing customization of the export process.|
51+
|FormFieldsImported|Triggered when form fields are successfully imported.|
52+
|FormFieldsImportFailed |Triggered when form fields import operation fails.|
53+
|FormFieldsImporting|Triggered before form fields are imported, allowing validation or modifications.|
54+
|FormFieldUnselected|Triggered when a form field is unselected.|
2855
|ImportFailed|Triggers when importing annotations fails in the PDF document.|
2956
|ImportStarted|Triggers when importing annotations starts in the PDF document.|
3057
|ImportSucceed|Triggers when importing annotations succeeds in the PDF document.|
58+
|IsDesignerModeChanged|Triggered when the designer mode state changes in the PDF Viewer.|
59+
|MoveSignature|Triggers when a signature is moved on a page in the PDF document.|
60+
|OnAnnotationDoubleClick|Triggers when an annotation is double-clicked.|
3161
|OnHyperlinkClick|Triggers when a hyperlink in the PDF document is clicked.|
3262
|OnHyperlinkMouseOver|Triggers when a hyperlink in the PDF document is hovered.|
3363
|OnPageClick|Triggers when a mouse click is performed on a page in the PDF document.|
@@ -41,6 +71,13 @@ The following events are available in the SfPdfViewer component.
4171
|PageMouseover|Triggers when the mouse pointer moves over a page.|
4272
|PrintEnd|Triggers when a print action is completed.|
4373
|PrintStart|Triggers when a print action starts.|
74+
|RemoveSignature|Triggers when a signature is removed from a page in the PDF document.|
75+
|ResizeSignature|Triggers when a signature is resized on a page in the PDF document.|
76+
|SignaturePropertiesChange|Triggers when the properties of a signature are changed on a page in the PDF document.|
77+
|SignatureSelected|Triggers when a signature is selected on a page in the PDF document.|
78+
|SignatureUnselected|Triggers when a signature is unselected on a page in the PDF document.|
79+
|ToolbarClicked|Triggers an event when a Custom Toolbar Item is clicked in the Toolbar.|
80+
|ValidateFormFields|Triggered when form fields are validated.|
4481
|ZoomChanged|Triggers when the magnification value changes.|
4582

4683
## Adding SfPdfViewer events to Blazor component
@@ -122,9 +159,4 @@ The following example illustrates how to handle the DocumentEdited event. In thi
122159
123160
```
124161

125-
[View sample in GitHub](https://github.com/SyncfusionExamples/blazor-pdf-viewer-examples/tree/master/Load%20and%20Save/Load%20a%20PDF%20document%20using%20created%20event)
126-
127-
## See also
128-
129-
* [Annotation Events in Blazor SfPdfViewer Component](./annotation/events)
130-
* [Form Fields Events in Blazor SfPdfViewer Component](./form-designer/events)
162+
[View sample in GitHub](https://github.com/SyncfusionExamples/blazor-pdf-viewer-examples/tree/master/Load%20and%20Save/Load%20a%20PDF%20document%20using%20created%20event)

0 commit comments

Comments
 (0)